Why does 'javac' still support "-Xbootclasspath" in jdk9 ?

Volker Simonis volker.simonis at gmail.com
Wed May 3 08:33:36 UTC 2017


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