Lanching off modulepath directory?
Alan Bateman
Alan.Bateman at oracle.com
Mon Mar 19 04:30:35 PDT 2012
On 19/03/2012 03:45, Sahoo wrote:
> As per [1], one should be able to launch VM pointing to a modulepath
> populated by javac:
>
> In order to support interactive development, the Java launcher can run
> a modular application directly from a module-path directory. When
> doing so it performs resolution before invoking the application’s
> entry point, although the resulting configuration is not stored for
> future use.
>
> But, I don't see any option in java launcher to specify modulepath.
> This is how my directory structure looks like:
>
> ./src
> ./src/m1
> ./src/m1/p1
> ./src/m1/p1/Foo.java
> ./src/m1/p2
> ./src/m1/p2/Bar.java
> ./src/m1/module-info.java
> ./src/m2
> ./src/m2/module-info.java
> ./modules
> ./modules/m1
> ./modules/m1/p1
> ./modules/m1/p1/Foo.class
> ./modules/m1/p2
> ./modules/m1/p2/Bar.class
> ./modules/m1/module-info.class
> ./modules/m2
> ./modules/m2/module-info.class
>
> `java -L modules -m m1` fails with following exception:
> Caused by: java.io.FileNotFoundException: modules/%jigsaw-library (No
> such file or directory)
>
> Is this a feature yet to be implemented in java launcher?
It's not in jigsaw/jigsaw yet but when it is then you should be able to
do "java -mp modules -m m1". Note the option is -modulepath or -mp, not
-L as that is used to specify a module library. The jmod command is used
to create and manage a module library where you may have multiple
versions of m1 and m2 installed (which may help with your other question).
-Alan
More information about the jigsaw-dev
mailing list