jpackage - tool for packaging self-contained Java applications.
jpackage [options]
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.
This option can be used multiple times.
Valid values are: {"app-image", "exe", "msi", "rpm", "deb", "pkg", "dmg"}
If this option is not specified a platform dependent default type will be created.
Defaults to the current working directory. (absolute path or relative to the current directory).
If specified, the temp dir will not be removed upon the task completion and must be removed manually.
If not specified, a temporary directory will be created and removed upon the task completion.
This module list, along with the main module (if specified) will be passed to jlink as the --add-module argument. If not specified, either just the main module (if --module is specified), or the default set of modules (if --main-jar is specified) are used.
This option can be used multiple times.
Each path is either a directory of modules or the path to a modular jar, and is absolute or relative to the current directory.
This option can be used multiple times.
If not specified, defaults to "--strip-native-commands --strip-debug --no-man-pages --no-header-files"
This option can be used multiple times.
If --runtime-image is not specified, jpackage will run jlink to create the runtime image using options specified by --jlink-options.
All files in the input directory will be packaged into the application image.
The keys "module", "main-jar", "main-class", "arguments", "java-options", "app-version", "icon", "linux-app-category", "linux-app-release", and "win-console" can be used.
These options are added to, or used to overwrite, the original command line options to build an additional alternative launcher. The main application launcher will be built from the command line options. Additional alternative launchers can be built using this option, and this option can be used multiple times to build multiple additional launchers.
This option can be used multiple times.
This option can be used multiple times.
This option can only be used if --main-jar is specified.
Either --module or --main-jar option can be specified but not both.
This module must be located on the module path.
When this option is specified, the main module will be linked in the Java runtime image. Either --module or --main-jar option can be specified but not both.
Defaults to the the main class name.
May only use alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters.
This can be different from the application name.
This name must be less than 16 characters long and be suitable for displaying in the menu bar and the application Info window. Defaults to the application name.
If not specified, the standard keychains are used.
The default value is "utilities".
(absolute path or relative to the current directory).
See create-app-image mode options to create the application image.
The keys "extension", "mime-type", "icon", and "description" can be used to describe the association.
This option can be used multiple times.
Icons, template files, and other resources of jpackage can be over-ridden by adding replacement resources to this directory.
Option is required when creating a runtime installer.
Defaults to the application name.
Generate an application package suitable for the host system:
For a modular application: jpackage -n name -p modulePath -m moduleName/className For a non-modular application: jpackage -i inputDir -n name \ --main-class className --main-jar myJar.jar From a pre-built application image: jpackage -n name --app-image appImageDir
Generate an application image:
For a modular application: jpackage --type app-image -n name -p modulePath \ -m moduleName/className For a non-modular application: jpackage --type app-image -i inputDir -n name \ --main-class className --main-jar myJar.jar To provide your own options to jlink, run jlink separately: jlink --output appRuntimeImage -p modulePath \ --add-modules moduleName \ --no-header-files [<additional jlink options>...] jpackage --type app-image -n name \ -m moduleName/className --runtime-image appRuntimeImage
Generate a Java runtime package:
jpackage -n name --runtime-image <runtime-image>