Why does 'javac' still support "-Xbootclasspath" in jdk9 ?
Jonathan Gibbons
jonathan.gibbons at oracle.com
Wed May 3 19:43:13 UTC 2017
Volker,
The general motivation was as much compatibility as possible with
pre-existing command lines and scripts. It has never been a goal for
JDK 9 javac to simplify/cleanup/remove options for the platform class
path. Note we didn't add any new options for the platform class path; we
just restricted their use to meaningful scenarios. (i.e. it doesn't make
sense to use them when compiling against modules.) All of these options
will go away in the fullness of time, as a result of the 1 + "3 back"
policy of JEP 247.
-Xbootclasspath: has always been a synonym for -bootclasspath. See JDK 8
javac -X.
-Xbootclasspath/p: only has a meaning when compiling for older releases,
and means the same as it always has.
-Xbootclasspath/a: has meaning for all releases. On older releases it
means what it always has; on 9, it can be used in the runtime for adding
agent classes, and because it makes sense for the runtime, it makes
sense to continue to allow it for javac.
-- Jon
On 5/3/17 12:02 PM, Volker Simonis wrote:
> Sure, but for this we have the standard "-bootclasspath" option.
>
> Why do we need to additionally keep the unsupported "-Xbootclasspath"
> versions? I think that's just confusing (by the way, they always have
> been confusing :)
>
> Also, I don't see how "-Xbootclasspath/p" and "-Xbootclasspath/a"
> would make any sense on Java 9?
>
>
> On Wed, May 3, 2017 at 6:07 PM, Jonathan Gibbons
> <jonathan.gibbons at oracle.com> wrote:
>> Volker,
>>
>> Options to set the platform class path are still reasonable to use in
>> conjunction with -target N, for older values of N. javac will give an error
>> if you try and use these options when compiling for a version that supports
>> modules (i.e. 9 or greater.)
>>
>> -- Jon
>>
>>
>>
>> On 5/3/17 1:33 AM, Volker Simonis wrote:
>>> Hi,
>>>
>>> I've just realized, that in jdk9, javac still supports the following
>>> three non-standard options:
>>>
>>> -Xbootclasspath:<path> Override location of bootstrap class files
>>> -Xbootclasspath/a:<path> Append to the bootstrap class path
>>> -Xbootclasspath/p:<path> Prepend to the bootstrap class path
>>>
>>> In jdk9, only "-Xbootclasspath/a:<path>" is still supported by the
>>> standard "java" launcher. The other two versions have been removed
>>> from "java".
>>>
>>> For "javac", the "-Xbootclasspath" options have a different semantics
>>> anyway - they don't specify the location of the bootstrap class files
>>> for the compiler, but the location where the compiler finds the
>>> bootstrap classes for the sour code it compiles. Therefore they are
>>> only meaningful in combination with the -source/-target option.
>>>
>>> Now jdk9 comes with a new "--release" option, which doesn't require a
>>> boot class path anymore. Additionally, "javac" supports the standard
>>> "-bootclasspath" option since long time and it is the recommended way
>>> of setting the boot class path if using the -source/-target option
>>> ("-Xbootclasspath:<path>" is actually mapped to "-bootclasspath"
>>> internally).
>>>
>>> Wouldn't it therefore make sense to completely remove the three
>>> non-standard versions of the "-Xbootclasspath" option from "javac" in
>>> jdk9?
>>>
>>> Thank you and best regards,
>>> Volker
>>
More information about the jdk9-dev
mailing list