Search code examples
javajava-9java-modulejava-platform-module-system

Does --add-opens work for dynamically created layers in JPMS?


I have a JPMS framework that dynamically creates JPMS layers and add modules to them. After some tests it seems to me that --add-opens JVM parameter works only for the boot layer, I mean the layer that is created when application starts.

So, the question - does --add-opens work for dynamically created layers in JPMS?

Concrete example

--add-opens java.base/java.lang=weld.servlet.shaded

will java.base/java.lang be opened to weld.servlet.shaded if weld.servlet.shaded is in dynamically created layer?


Solution

  • The answer was given by @AlanBateman

    The --add-opens CLI option is for the boot layer only.