Created
April 3, 2019 20:12
-
-
Save jpomykala/92be19a285eb2fce726d7d03686da2f0 to your computer and use it in GitHub Desktop.
Java 9+ - Using jlink
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
rm -rf ./build/classes/ | |
rm -rf ./build/jar/ | |
rm -rf ./build/dist/ | |
mkdir -p build/classes | |
mkdir -p build/jar | |
# compile | |
javac -d build/classes/io.simplelocalize.cli ./src/main/java/module-info.java ./src/main/java/io/simplelocalize/cli/Main.java | |
#create *.jar | |
jar -c -f ./build/jar/simplelocalize-cli.jar -C build/classes/io.simplelocalize.cli . | |
# create minimal jre | |
jlink --module-path ${JAVA_HOME}:libs:build/jar --add-modules io.simplelocalize.cli --output ./build/dist | |
#run | |
./build/dist/bin/java -cp ./build/jar/simplelocalize-cli.jar io.simplelocalize.cli.Main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment