Combining -Xmodule and --add-reads

Alan Bateman Alan.Bateman at
Tue Aug 23 13:22:12 UTC 2016

On 23/08/2016 13:02, Sander Mak wrote:

> :
> I tried to re-write this setup to the new command-line flags on 9-ea+131-jigsaw-nightly-h5400-20160818:
> javac -Xmodule:undertest \
>        --add-reads undertest=org.junit \
>        --module-path mods:lib-test \
>        -d mods-test/undertest $(find src-test -name '*.java')
> To my surprise, this yields compilation errors telling me that package 'org.junit' does not exist. Somehow, it seems like the add-reads is failing. Or maybe something else is wrong, but I'm missing it.
I assume `--add-modules org.junit` will fix this, the reason being that 
no module requires org.junit. On --add-reads failing then this is a 
scenario where javac and the runtime differ in behavior. I think Jon is 
planning a torture test to shake out such differences. I guess one could 
argue here that the --add-modules should be implied but that could be 
confusion too, esp. when the target module is not otherwise resolved.


More information about the jigsaw-dev mailing list