Return to site

โ˜• JAVA TRICK: JPackage vs Modules

ยท java

๐‡๐Ž๐Ž๐Š ๐Ÿ”Š

You know 'jpackage', but... wait, do you know 'jpackage'?๐Ÿ’ก

It is a command-line tool that takes a whole Java app as input and produces a fully self-contained๐Ÿ“ฆ application image;

meaning it includes your code, dependencies and a Java runtime.

It create a runtime for your app with 'jlink', which you can fully configure through 'jpackage';

or you can pass it the path to a runtime image that you already created.

Further configuration options include application metadata like icons and licenses, installation options and launchers as well as JVM and program options.

'jpackage' outputs in platform-specific formats like deb and rpm for Linux or exe and msi for windows.

Now that you know 'jpackage', did you know that it can do all that for modular as well as non-modular applications?

Just awesome, isn't it?๐Ÿคฉ

๐ƒ๐„๐…๐ˆ๐๐„ ๐Ÿ‘ฉโ€๐Ÿซ

The jpackage tool will take as input a Java application and a Java run-time image, and produce a Java application image that includes all the necessary dependencies.

It will be able to produce a native package in a platform-specific format, such as an exe on Windows or a dmg on macOS.

Each format must be built on the platform it runs on, there is no cross-platform support.

The tool will have options that allow packaged applications to be customized in various ways.

๐‚๐Ž๐Œ๐Œ๐€๐๐ƒ ๐Ÿ‘จโ€๐Ÿ’ป

๐‘—๐‘๐‘Ž๐‘๐‘˜๐‘Ž๐‘”๐‘’ -๐‘– ๐‘–๐‘›๐‘๐‘ข๐‘ก๐ท๐‘–๐‘Ÿ -๐‘› ๐‘›๐‘Ž๐‘š๐‘’ --๐‘š๐‘Ž๐‘–๐‘›-๐‘๐‘™๐‘Ž๐‘ ๐‘  ๐‘๐‘™๐‘Ž๐‘ ๐‘ ๐‘๐‘Ž๐‘š๐‘’ --๐‘š๐‘Ž๐‘–๐‘›-๐‘—๐‘Ž๐‘Ÿ ๐‘š๐‘ฆ๐ฝ๐‘Ž๐‘Ÿ.๐‘—๐‘Ž๐‘Ÿ