You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo ""
echo "${info} *** Create an executable version of the com.greetings module *** ${normal}"
if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] ; then
# Windows users: please not that if the below fails due to JAVA_HOME substitution, please hard-code the JAVA_HOME path into the script
jlink --module-path "${JAVA_HOME}\jmods;mlib"
--add-modules com.greetings,java.base
--output executable
else
jlink --module-path "${JAVA_HOME}/jmods:mlib"
--add-modules com.greetings,java.base
--output executable
fi
Check out documentation on jlink to survive at this stage
echo ""
echo "${info} *** Displaying the contents (modules) of the 'executable' folder *** ${normal}"
runTree executable
Compile the 'hello world' example using:
Create JAR modules out of the class files:
I am able to run above two scripts but getting issues while running below script.
Run
jlink
to produce a new run-time image (distributable JDK + your app) for the 'hello world' example:Error- rahul_bhardwaj@AHM-LL-RahulBh:~/java9/jdk9-jigsaw/session-2-jlink/01_JLink$ ./link.sh
*** Removing any existing executable directories *** �
*** Create an executable version of the com.greetings module *** �
Error: Module java.base not found
Modified link.sh file -> `JAVA_HOME="C:\Program Files\Java\jdk-9.0.4"
set -eu
source ../../common-functions.sh
echo ""
echo "${info} *** Removing any existing executable directories *** ${normal}"
rm -rf executable
echo ""
echo "${info} *** Create an executable version of the com.greetings module *** ${normal}"
if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] ; then
# Windows users: please not that if the below fails due to JAVA_HOME substitution, please hard-code the JAVA_HOME path into the script
jlink --module-path "${JAVA_HOME}\jmods;mlib"
--add-modules com.greetings,java.base
--output executable
else
jlink --module-path "${JAVA_HOME}/jmods:mlib"
--add-modules com.greetings,java.base
--output executable
fi
Check out documentation on jlink to survive at this stage
echo ""
echo "${info} *** Displaying the contents (modules) of the 'executable' folder *** ${normal}"
runTree executable
****************************************************************************************************************************
The value to
--module-path
is a PATH of directories containing the packaged modules.Replace the path separator ':' with ';' on Microsoft Windows.
****************************************************************************************************************************`
The text was updated successfully, but these errors were encountered: