I've been using github actions and jpackage to make releases of my apps. Recently noticed that jpackage doesn't know how to tell users they have an old version of java.
I was told the solution is to use jlink. jlink won't run wtihout knowing which dependencies to add. That leads to jdeps. The relevant part of the action script is
name: Build installation package
shell: bash
run: |
set -x
set -o pipefail
APP_VERSION=$(ls -1 target/package/RobotOverlord-*-with-dependencies.jar | sed "s/.*RobotOverlord-\([^-]*\)-with-dependencies.jar/\1/")
sed -i.bak "s/\(--app-version\).*/\1 $APP_VERSION/" src/main/package/jpackage.cfg
APP_NAME="RobotOverlord-${{ matrix.os_label }}"
# copy runtime dependencies into `target/dependency`
mvn dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=target/dependency
# compute module list from the fat jar, ignore missing deps to avoid failure on unknown automatic modules
JAR="target/package/RobotOverlord-$APP_VERSION-with-dependencies.jar"
MODULES=$(jdeps --multi-release ${{ env.JAVA_VERSION }} --module-path target/dependency --print-module-deps --ignore-missing-deps "$JAR")
echo "jdeps modules: $MODULES"
(continued...)