modulepath with multiple modules and inability to install more than one module using jmod

Sahoo sanjeeb.sahoo at oracle.com
Wed Mar 21 22:34:40 PDT 2012


Will I assume it to be a limitation then?

On Tuesday 20 March 2012 09:49 AM, Sahoo wrote:
> I have the following source layout:
> ./src/m1-1.0/m1/p1/Foo.java
> ./src/m1-1.0/m1/p2/Bar.java
> ./src/m1-1.0/module-info.java
> ./src/m2-1.0/module-info.java
>
> I have followed the recommendation of encoding version number in 
> source directory name as mentioned in the modulepath/javac pdf, 
> although I am convinced about it and hence have a separate email about 
> it.
>
> This is how I invoke javac:
>
> javac -d modules/ -modulepath src/:modules/ `find src/ -name "*.java"`
>
> I am slightly confused as to whether I should use -modulepath src/ or
> -modulepath modules/ or -modulepath src/:modules/. I guess what I have
> used covers the case where module/ already contains some compiled
> modules that are required by the current compilation. Someone can help me
> understand this better.
>
> This generates classes like this:
> ./modules/m1-1.0/m1/p1/Foo.class
> ./modules/m1-1.0/m1/p2/Bar.class
> ./modules/m1-1.0/module-info.class
> ./modules/m2-1.0/module-info.class
>
> Because the classes are generated under modules/m1-1.0 and
> modules/m2-1.0 instead of modules/, I can't add more than one module at
> a time. e.g., I can't do:
>
> jmod -L mlib install modules/ m1 m2
>
> This fails with:
> I/O error: modules/m1/module-info.class (No such file or directory)
>
> I have to do:
> jmod -L mlib install modules/m1-1.0 m1
> jmod -L mlib install modules/m2-1.0 m2
>
> It's a bit inconvenient as you can see.
>
> Thanks,
> Sahoo




More information about the jigsaw-dev mailing list