diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index c80be8844..29939fb26 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -73,13 +73,21 @@ jobs: run: | cp LICENSE.txt target cp target/cryptomator-*.jar target/mods + - name: Run jlink with help option + id: jep-493-check + run: | + JMOD_PATHS="openjfx-jmods" + if $(${JAVA_HOME}/bin/jlink --help | grep -o "Linking from run-time image enabled"); then + JMOD_PATHS="${JAVA_HOME}/jmods:${JMOD_PATHS}" + fi + echo "jmod_paths=${JMOD_PATHS}" >> "$GITHUB_OUTPUT" - name: Run jlink #Remark: no compression is applied for improved build compression later (here appimage) run: > ${JAVA_HOME}/bin/jlink --verbose --output runtime - --module-path "${JAVA_HOME}/jmods:openjfx-jmods" + --module-path "${{ steps.jep-493-check.outputs.jmod_paths }}" --add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,javafx.base,javafx.graphics,javafx.controls,javafx.fxml,jdk.unsupported,jdk.security.auth,jdk.accessibility,jdk.management.jfr,jdk.net,java.compiler --strip-native-commands --no-header-files diff --git a/.github/workflows/mac-dmg-x64.yml b/.github/workflows/mac-dmg-x64.yml index a26e32565..761072e75 100644 --- a/.github/workflows/mac-dmg-x64.yml +++ b/.github/workflows/mac-dmg-x64.yml @@ -75,13 +75,21 @@ jobs: run: | cp LICENSE.txt target cp target/cryptomator-*.jar target/mods + - name: Run jlink with help option + id: jep-493-check + run: | + JMOD_PATHS="openjfx-jmods" + if $(${JAVA_HOME}/bin/jlink --help | grep -o "Linking from run-time image enabled"); then + JMOD_PATHS="${JAVA_HOME}/jmods:${JMOD_PATHS}" + fi + echo "jmod_paths=${JMOD_PATHS}" >> "$GITHUB_OUTPUT" - name: Run jlink #Remark: no compression is applied for improved build compression later (here dmg) run: > ${JAVA_HOME}/bin/jlink --verbose --output runtime - --module-path "${JAVA_HOME}/jmods:openjfx-jmods" + --module-path "${{ steps.jep-493-check.outputs.jmod_paths }}" --add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,javafx.base,javafx.graphics,javafx.controls,javafx.fxml,jdk.unsupported,jdk.accessibility,jdk.management.jfr,java.compiler --strip-native-commands --no-header-files diff --git a/.github/workflows/mac-dmg.yml b/.github/workflows/mac-dmg.yml index 27dd8cfdc..d21a2b3cd 100644 --- a/.github/workflows/mac-dmg.yml +++ b/.github/workflows/mac-dmg.yml @@ -76,13 +76,21 @@ jobs: run: | cp LICENSE.txt target cp target/cryptomator-*.jar target/mods + - name: Run jlink with help option + id: jep-493-check + run: | + JMOD_PATHS="openjfx-jmods" + if $(${JAVA_HOME}/bin/jlink --help | grep -o "Linking from run-time image enabled"); then + JMOD_PATHS="${JAVA_HOME}/jmods:${JMOD_PATHS}" + fi + echo "jmod_paths=${JMOD_PATHS}" >> "$GITHUB_OUTPUT" - name: Run jlink #Remark: no compression is applied for improved build compression later (here dmg) run: > ${JAVA_HOME}/bin/jlink --verbose --output runtime - --module-path "${JAVA_HOME}/jmods:openjfx-jmods" + --module-path "${{ steps.jep-493-check.outputs.jmod_paths }}" --add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,javafx.base,javafx.graphics,javafx.controls,javafx.fxml,jdk.unsupported,jdk.accessibility,jdk.management.jfr,java.compiler --strip-native-commands --no-header-files diff --git a/.github/workflows/win-exe.yml b/.github/workflows/win-exe.yml index e42c8486b..bb740bb3f 100644 --- a/.github/workflows/win-exe.yml +++ b/.github/workflows/win-exe.yml @@ -82,13 +82,21 @@ jobs: run: | cp LICENSE.txt target cp target/cryptomator-*.jar target/mods + - name: Run jlink with help option + id: jep-493-check + run: | + JMOD_PATHS="openjfx-jmods" + if $(${JAVA_HOME}/bin/jlink --help | grep -o "Linking from run-time image enabled"); then + JMOD_PATHS="${JAVA_HOME}/jmods:${JMOD_PATHS}" + fi + echo "jmod_paths=${JMOD_PATHS}" >> "$GITHUB_OUTPUT" - name: Run jlink #Remark: no compression is applied for improved build compression later (here msi) run: > ${JAVA_HOME}/bin/jlink --verbose --output runtime - --module-path "jfxjmods;${JAVA_HOME}/jmods" + --module-path "${{ steps.jep-493-check.outputs.jmod_paths }}" --add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,javafx.base,javafx.graphics,javafx.controls,javafx.fxml,jdk.crypto.mscapi,jdk.unsupported,jdk.accessibility,jdk.management.jfr,java.compiler --strip-native-commands --no-header-files diff --git a/dist/linux/appimage/build.sh b/dist/linux/appimage/build.sh index e18054ae6..6bfdbd5c7 100755 --- a/dist/linux/appimage/build.sh +++ b/dist/linux/appimage/build.sh @@ -51,11 +51,17 @@ if [ $POM_JFX_VERSION -ne $JMOD_VERSION ]; then fi -# add runtime +# create runtime +## check for JEP 493 +JMOD_PATHS="openjfx-jmods" +if $(${JAVA_HOME}/bin/jlink --help | grep -o "Linking from run-time image enabled"); then + JMOD_PATHS="${JAVA_HOME}/jmods:${JMOD_PATHS}" +fi +## create runtime image ${JAVA_HOME}/bin/jlink \ --verbose \ --output runtime \ - --module-path "${JAVA_HOME}/jmods:openjfx-jmods" \ + --module-path "${JMOD_PATHS}" \ --add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,javafx.base,javafx.graphics,javafx.controls,javafx.fxml,jdk.unsupported,jdk.security.auth,jdk.accessibility,jdk.management.jfr,jdk.net,java.compiler \ --strip-native-commands \ --no-header-files \ diff --git a/dist/mac/dmg/build.sh b/dist/mac/dmg/build.sh index e1bc3a125..e7fabb1be 100755 --- a/dist/mac/dmg/build.sh +++ b/dist/mac/dmg/build.sh @@ -75,10 +75,16 @@ mvn -B -Djavafx.platform=mac -f../../../pom.xml clean package -DskipTests -Pmac cp ../../../LICENSE.txt ../../../target cp ../../../target/${MAIN_JAR_GLOB} ../../../target/mods -# add runtime +# create runtime +## check for JEP 493 +JMOD_PATHS="openjfx-jmods" +if $(${JAVA_HOME}/bin/jlink --help | grep -q "Linking from run-time image enabled"); then + JMOD_PATHS="${JAVA_HOME}/jmods:${JMOD_PATHS}" +fi +## create custom runtime ${JAVA_HOME}/bin/jlink \ --output runtime \ - --module-path "${JAVA_HOME}/jmods:openjfx-jmods" \ + --module-path "${JMOD_PATHS}" \ --add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,javafx.base,javafx.graphics,javafx.controls,javafx.fxml,jdk.unsupported,jdk.security.auth,jdk.accessibility,jdk.management.jfr,java.compiler \ --strip-native-commands \ --no-header-files \ diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index 28036e6f8..dc820d0eb 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -89,10 +89,16 @@ Remove-Item -Recurse -Force -Path ".\resources\javafx-jmods" -ErrorAction Ignore Move-Item -Force -Path ".\resources\javafx-jmods-*" -Destination ".\resources\javafx-jmods" -ErrorAction Stop ## create custom runtime +### check for JEP 493 +$jmodPaths="$buildDir/resources/javafx-jmods"; +if ((& "$Env:JAVA_HOME\bin\jlink" --help | Select-String -Pattern "Linking from run-time image enabled" -SimpleMatch | Measure-Object).Count -gt 0 ) { + $jmodPaths="$Env:JAVA_HOME/jmods;" + $jmodPaths; +} +### create runtime & "$Env:JAVA_HOME\bin\jlink" ` --verbose ` --output runtime ` - --module-path "$Env:JAVA_HOME/jmods;$buildDir/resources/javafx-jmods" ` + --module-path $jmodPaths ` --add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,jdk.unsupported,jdk.accessibility,jdk.management.jfr,jdk.crypto.mscapi,java.compiler,javafx.base,javafx.graphics,javafx.controls,javafx.fxml ` --strip-native-commands ` --no-header-files `