java -modulepath
Alan Bateman
Alan.Bateman at oracle.com
Fri May 13 09:48:13 PDT 2011
I've started to look at supporting "exploded modules" as a prerequisite
to changing the jdk build so that it compiles as modules rather than the
post-processing step as it is now. The idea is that we be able to
compile and run the modules on the module path without requiring them to
be installed in a module library. Aside from the JDK build it would also
be nice to be able to compile and run in the development environment
without needing to install.
As an initial (and very limited) prototype I've added a -modulepath (and
-mp) option to the launcher to specify a modulepath. That allows us to do:
javac -d modules/ -modulepath modules/
java -modulepath modules/ -m foo
When running with the -modulepath option then configuration is generated
at startup rather than loading it from the module library. That is very
expensive now and something to look at it. Implementation wise it's just
a simple Library implementation that uses the usual module library as
its parent.
This prototype brings up a couple of issues that need examination.
Performance and whether the configuration can be cached for example.
Another one is native libraries as up until this point the javac
modulepath has been for classes only. This is somewhat related to how
module with native libraries are supported in the module library [1].
Another issue is that we have code in various places of the JDK that
currently assume a system class loader so care needs to be taken when
computing the configuration at startup. This is something that Mandy and
Sean ran into in a different context [2].
For now this is just a prototype, the webrev is here but doesn't require
review:
http://cr.openjdk.java.net/~alanb/jigsaw-mp-prototype1/webrev/
I have also some hotspot changes to allow for the case that the jdk.boot
module isn't installed in the module library, as would arise during the
build.
-Alan
[1] http://openjdk.java.net/projects/jigsaw/doc/topics/nativecode.html
[2] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2011-March/001186.html
More information about the jigsaw-dev
mailing list