sun.boot.class.path

Mandy Chung mandy.chung at oracle.com
Mon Apr 5 10:02:56 PDT 2010


Jonathan Gibbons wrote:
> Jigsaw runtime folk,
>
> Currently, javac relies on the Java runtime setting the system 
> property sun.boot.class.path being set to the bootclasspath for the 
> underlying JVM being used to run javac. This system property is used 
> to locate platform classes when the javac -Xbootclasspath option has 
> not been given.
>
> Going forward, can I rely on this property always being set, in both 
> legacy mode and module mode for a JVM?
>

In the modular jdk, bootclasspath would eventually go away.  You can't 
reply on the sun.boot.class.path property value to locate the platform 
classes.
> The issue for javac is to how to handle compilations for older values 
> of -source.
>
> The options are:
> 1. rely on sun.boot.class.path being available if the javac 
> -Xbootclasspath option is not set.
>
> 2. Give an error for older values of -source if -Xbootclasspath is not 
> set.  Setting -Xbootclasspath is good practice anyway, and Joe Darcy 
> has already advocated making this a warning.
>
> 3. Adapt the javac internals so that if javac -Xbootclasspath is not 
> set, javac will use the Jigsaw default platform module, assuming 
> Jigsaw is available and installed. (Eventually, this will normally 
> always be the case.)
IMO, option #3 is the right solution and issuing a warning if 
-Xbootclasspath is not set for older values of -source seems good to me.

There is an open issue which platform module javac should use to find 
platform classes.   Such platform module should find all platform 
classes that are installed in the system module library of one or more 
platform modules.

The minimal module image is "jdk.base" that contains a subset of the 
JRE.   Currently, the jigsaw default platform module is "jdk at 7-ea" that 
is intended to represent the full JRE (the name of this module should 
probably be "jre").  The default platform module requires all JRE 
modules be installed.  If javac runs on the minimal module image (i.e. 
jdk-base-image), it will fail to find the default platform module 
"jdk at 7-ea".   I'm looking into a solution for this.  For "javac's legacy 
mode", probably javac needs to use "jdk.legacy" module that optionally 
depends on all JRE modules so that the "jdk.legacy" module can be 
installed in the minimal module image while it can find classes from 
other platform modules later installed on a system module library.  I'll 
send out the details of this idea for discussion.

Mandy




More information about the jigsaw-dev mailing list