-classpath vs --class-path
Nicolai Parlog
nipa at codefx.org
Thu Jan 5 23:47:43 UTC 2017
Hi Jonathan,
thanks for checking things out. :)
so long ... Nicolai
On 05.01.2017 22:48, Jonathan Gibbons wrote:
> Nicolai,
>
> We've identified the cause of the issue you reported. Although
> javac accepts --class-path as an alias for -cp and -classpath, what
> is notable about your example is that it is using "classpath
> wildcards" (i.e. the "*" in -cp "mods/*"), which is implemented
> within the native javac launcher, and not in the mainstream javac
> code. And yes, in the code in question, --class-path is not
> supported, and probably should be.
>
> Filed: https://bugs.openjdk.java.net/browse/JDK-8172309
>
> -- Jon
>
> On 01/05/2017 08:33 AM, Jonathan Gibbons wrote:
>> Thank you for the report. It is obviously intended that these
>> options should simply be aliases for each other, but I will see
>> if there is something else going on to explain what you are
>> seeing.
>>
>> -- Jon
>>
>>
>> On 1/5/17 3:23 AM, Nicolai Parlog wrote:
>>> Hi,
>>>
>>> during experimentation I encountered compiler behavior that I
>>> found rather strange: It looks like the -classpath and
>>> --class-path options do not behave the same way.
>>>
>>> In my experiment I create a bunch of modules in 'mods' and then
>>> create the last one by putting the modules on the class path
>>> (no reason, just playing around):
>>>
>>> javac -cp "mods/*" -d classes/advent
>>> src/advent/advent/Main.java
>>>
>>> This works and '-classpath' does, too, but '--class-path'
>>> doesn't. In that case the compiler complains that the packages
>>> contained by the modules in 'mods' do not exist.
>>>
>>> For an executable version see here:
>>>
>>>
>>> https://github.com/CodeFX-org/demo-jigsaw-advent-calendar/blob/compi
ling-with-deps-as-modules/compileAndRun.sh#L41-L48
>>>
>>>
>>>
>>>
I noticed this on b146 but it also exists in b148; both EA-Jigsaw
>>> builds.
>>>
>>> so long ... Nicolai
>>>
>>>
>>>
>>
>
--
PGP Key:
http://keys.gnupg.net/pks/lookup?op=vindex&search=0xCA3BAD2E9CCCD509
Web:
http://codefx.org
a blog about software development
https://www.sitepoint.com/java
high-quality Java/JVM content
http://do-foss.de
Free and Open Source Software for the City of Dortmund
Twitter:
https://twitter.com/nipafx
More information about the jigsaw-dev
mailing list