issues with jdk/make/modules/

Jonathan Gibbons Jonathan.Gibbons at Sun.COM
Tue Jan 19 13:52:03 PST 2010

  The current jigsaw forest does not build with the latest javac that I 
would like to put back.

The build fails like this:

> make[3]: Entering directory 
> `/mnt/w/jjg/work/jigsaw/jigsaw.testbuild/jdk/make/modules'
> SRC=../../src/share/modules 
> BIN=/mnt/w/jjg/work/jigsaw/jigsaw.testbuild/build/linux-amd64/bin 
> CLASSES=/mnt/w/jjg/work/jigsaw/jigsaw.testbuild/build/linux-amd64/classes 
> TMP=/mnt/w/jjg/work/jigsaw/jigsaw.testbuild/build/linux-amd64/tmp/jigsaw 
> MLIB=/mnt/w/jjg/work/jigsaw/jigsaw.testbuild/build/linux-amd64/lib/modules 
> \
>     JIGSAW_TRACE=3 sh boot base awt swing tools
> -- jdk.boot
> error: module library not found: 
> /mnt/w/jjg/work/jigsaw/jigsaw.testbuild/build/linux-amd64/lib/modules
> 1 error

In I see some lines of the form:

   $BIN/javac -source 7 -d $MCLS -modulepath $SRC $SRC/$m/

This line looks suspect, if only for putting what looks like a source 
directory on the module path. It should probably be:

   $BIN/javac -source 7 -d $MCLS -modulepath $MCLS -sourcepath $SRC 

It's also not the best way to invoke javac -- once per source file, 
using sourcepath, as compared to a single invocation for all relevant files.

Finally, this is the beginning of the iceberg of how to use javac to 
bootstrap the module system into existence.

The error message from javac (module library not found) indicates that 
javac is trying to do a normal "end user" compilation, involving the 
default system module library. This is new functionality in this version 
of javac.

The question is, how should we be handling this situation here?
-- Should we simply create (mkdir) an empty modules directory to keep 
javac happy?
-- Or, should javac have an option to disable looking for the system 
module library?
-- Or should javac not be looking for the system module library if it 
can satisfy all references via the command line.
-- Or should javac be running in a special bootstrap mode that is used 
for internal cases like this?

-- Jon

More information about the jigsaw-dev mailing list