Avoiding same-package conflicts

Alan Bateman Alan.Bateman at oracle.com
Thu Oct 29 13:48:59 UTC 2015

On 28/10/2015 20:34, Karl Sanders wrote:
> Hi,
> I'm trying out the JDK 9 EA with Jigsaw.
> I created two modules, A and B, which are required by module C.
> Modules A and B contain a non-exported package with the same name.
> After compiling each module separately I start module C and get a
> java.lang.reflect.LayerInstantiationException saying that modules A
> and B contain a package with the same name.
The restriction is that no two modules with the same package 
(irrespective of whether it is exported or not, or who reads the 
modules) can be mapped to the same class loader. At this time, all 
modules on the application module path are mapped to the application 
class loader and I'm guessing that this is what it arising here.


More information about the jigsaw-dev mailing list