The whole packaging process can be done by just executing this script or you may manually follow sections below.
First, get the list of java modules dependencies:
jdeps --list-deps target/bobby-1.0-SNAPSHOT.jarThen create the JRE with the given dependencies:
jlink --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules java.base,java.desktop,java.logging,java.management,java.naming,java.sql,java.xml --output target/jreThen the JAR can be run with the created JRE:
target/jre/bin/java -jar target/bobby-1.0-SNAPSHOT.jar- Download
launch4j. - Use file
run/launch4j.xmlas a config file. It will create an executabletarget/bobby.exe
Create a ZIP file containing:
|- jre
bobby-1.0-SNAPSHOT.jar
bobby.exe
bobby.sh