Skip to content

Instantly share code, notes, and snippets.

@vinaysshenoy
Created November 15, 2024 05:38
Show Gist options
  • Save vinaysshenoy/398ae93a2f85588dae5b96bb17e8c641 to your computer and use it in GitHub Desktop.
Save vinaysshenoy/398ae93a2f85588dae5b96bb17e8c641 to your computer and use it in GitHub Desktop.
Bundle minimal JRE with application
#!/usr/bin/env bash
./gradlew -version
./gradlew shadowJar --no-daemon
jdkModules=$(jdeps --print-module-deps --ignore-missing-deps ./build/libs/application.jar)
echo "Building JRE with modules: $jdkModules"
rm -rf ./build/libs/jre
jlink --compress zip-6 --strip-debug --no-header-files --no-man-pages --output ./build/libs/jre --add-modules "$jdkModules"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment