[Question] Accessibility of each modules

KUBOTA Yuji kubota.yuji at gmail.com
Tue Sep 5 11:01:57 UTC 2017


Hi all,

I have a question about accessibility of each modules: unnamed,
automatic and named modules.
* unnamed: the JAR compiled by java 8 and speficied by --class-path.
* automatic: the JAR compiled by Java 8 and specified by --module-path.
* named: the modular JAR.

I ran quick-start's example program on java 9+181 and 8u141, and
confirmed the following results.
* Named modules can call autonamed modules.
* Automatic modules can *NOT* call named modules.
* We can run unnamed modules with only unnamed modules.

You can reproduce it by https://github.com/ykubota/jigsaw-sample-accessibility

I guessed that every modules can be accessed each other if
`--illegal-access=permit` or/and `--add-exports` is given, but it does
not seems to be fine.
I guess that modules and classes (unnamed module) cannot be existed at
the same time because `BuiltinClassLoader` seems to branch by
`packageToModule` field in it.

Is my understanding correct?

Thanks,
Yuji


More information about the jigsaw-dev mailing list