3

There is modularized application http://github.com/cuba-platform/cuba-cli that can be easily bundled with jlink using Gradle:

./gradlew bundle

At the moment it bundles application with Custom JRE image on Java 10 only with JAVA installed in operating system.

In bash it is:

jlink --module-path $JAVA_HOME/jmods:modules,
    --add-modules cli
    --output ./build/bundle
    --launcher launch=cli/Cli

How can I produce application bundles for Windows and Mac OS if I build my application on Linux? Can I just extract JDK for Windows / Mac OS somewhere and perform linking with those platform-specific JDKs?

jreznot
  • 2,694
  • 2
  • 35
  • 53
  • 3
    Yes, it is possible. You need to download the JDK for the target platform and then specify that JDK's `jmod` directory on the module path (that you specify to --add-modules). – Alan Bateman May 16 '18 at 15:40
  • @AlanBateman This, however, will not work vice versa (building Linux/MacOS images on Windows) because Windows is unable to set UNIX file permissions and executable flags for java launcher. – ZhekaKozlov May 17 '18 at 05:21
  • The issue of fixing up file permissions when you copy something (not just a run-time image) from one system to another can be an issue, yes. – Alan Bateman May 17 '18 at 11:39

0 Answers0