module/bootclass troubles with jdk9

Alan Bateman Alan.Bateman at oracle.com
Tue Feb 3 08:17:17 UTC 2015


On 03/02/2015 04:09, Martin Buchholz wrote:
> I'm trying to use jdk9-b34 and see that rt.jar and friends are gone.
> Are we in jigsaw-land yet?
> javac doesn't seem to know about any -modulepath flag yet.
> (javac -help, javac -X is module-unaware)
> How do I specify a bootclasspath for jdk9-b34?
> You can't use a jimage with -bootclasspath, and -modulepath doesn't seem to
> work (even though I see references to it in the javac sources)
>
> How will one be able to use javac/jdk10 to target jdk9?  Traditionally,
> -target 9 -source 9 and -bootclasspath with some collection of jdk9 jar
> files.  But jdk9 bootclasspath jars are gone, and I don't see anything to
> replace it?
>
> (Background: trying to fix up jsr166 ant build script for jdk9-latest)

JEP 220 went into jdk9-b41 so that's the first build where you should 
have noticed the change to the runtime image layout and where rt.jar and 
tools.jar have been replaced. Prior to this then JEP 201 went in to 
reorganize the source code by module and change significantly the build 
so that the compilation unit is module rather than the java sources in 
each repository.

We're still not in "module land" yet, there's a standard module system 
for JSR 376 to define and there will be JEP for the implementation too. 
So too early to be looking for options like -modulepath.

For tools that need to access the classes and resources in another 
runtime image then the proposal (in JEP 220) is the jrt file system 
provider. At this time, this works for a tool running on JDK 9 to access 
the contents of its own image, or a tool running on JDK 8 to access the 
contents of a target JDK 9 image. So far then javac, jdeps and rmic have 
been changed to use the file system API. We're not yet at the point 
where a tool running on a build of JDK 9 or JDK 10 can access the 
contents of different JDK 9 or JDK 10 build but we'll get there (in a 
few months I hope, there are a few issues to sort out first and a number 
of other big changes in this areas that are higher priority at the moment).

For javac then there are other ideas to support compiling for previous 
releases, Jon might want to say more on this.

-Alan



More information about the jigsaw-dev mailing list