JPMS module-path and layers

Alan Bateman Alan.Bateman at oracle.com
Tue May 19 13:50:43 UTC 2020


On 19/05/2020 09:00, Alex Orlov wrote:
> Hi all,
>   
> I want to understand all details of module-path and layers in java9+ and I have two questions:
> *  As I understand modules on module-path are added automatically only to boot layer and not added automatically to any other layers. I mean, if any child layers are created module-path will be ignored for them. Is this correct?
> *  Not all modules from module-path are added to boot layer, but only main module and dependent modules. For example, if we have  A ,  B ,  C ,  D modules on module-path and  A is main module and uses  B ,  B uses  C , then  D module won't be added to boot layer. Is this correct?
> Could anyone help me with these questions?
>
Have you been through the java.lang.module package description and the 
APIs for Configuration.resolve? I think the main thing to understand is 
that A, B, C, and D are observable when doing the module resolution and 
creating the readability graph for the boot layer. D is not in the 
readability graph because it's not required by any of the other modules 
in the graph. Later you will use Configuration.resolve to do module 
resolution for what will become the child layer. The module finders that 
you specify to the resolve method will determine if D is observable or 
not. Depending on the root modules that you specify to resolve, then it 
might be that D is the readability graph for the child layer.

-Alan




More information about the jigsaw-dev mailing list