I am creating a sample application with 3 modules user
, dept
and account
. In my user module, I have a main class and compile my modules with the following command:
javac -d target --module-source-path src $(find -name "*.java")
After compiling, execute following command for run:
java -p target -m com.user/com.user.info.Launcher
The output after running java modules are successful. But when trying to create runtime image using jlink
the image created successfully but module executable script is not there. For create an image, I am using the following command:
jlink --module-path $JAVA_HOME/jmods:target --add-modules com.user --output my-app
In, runtime image, I have bin
directory, but this directory contains only java
and keynote
script. I am expecting user main class script as well, for executing my application.
My Java version as below:
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+165)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+165, mixed mode)
How can I resolve this problem?