Why does 'javac' still support "-Xbootclasspath" in jdk9 ?
Jonathan Gibbons
jonathan.gibbons at oracle.com
Wed May 3 16:07:27 UTC 2017
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