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.
(absolute path or relative to the current directory)
(absolute path or relative to the current directory).
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.
(absolute path or relative to the current directory)
If --runtime-image is not specified, jpackage will run jlink to create the runtime image using options specified by --jlink-options.
(absolute path or relative to the current directory)
All files in the input directory will be packaged into the application image.
This option can be used more than once.
(absolute path or relative to the current directory)
The keys "module", "main-jar", "main-class", "description", "arguments", "java-options", "app-version", "icon", "launcher-as-service", "win-console", "win-shortcut", "win-menu", "linux-app-category", and "linux-shortcut" 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 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)
(absolute path or relative to the current directory)
The keys "extension", "mime-type", "icon", and "description" can be used to describe the association.
This option can be used multiple times.
(absolute path or relative to the current directory)
(absolute path or relative to the current directory)
Icons, template files, and other resources of jpackage can be over-ridden by adding replacement resources to this directory.
(absolute path or relative to the current directory)
Option is required when creating a runtime installer.
Defaults to the application name.
This option can be used more than once.
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>
Sign the predefined application image (on macOS):
jpackage --type app-image --app-image <app-image> \ --mac-sign [<additional signing options>...] Note: the only additional options that are permitted in this mode are: the set of additional mac signing options and --verbose
Icons, template files, and other resources of jpackage can be over-ridden by adding replacement resources to this directory. jpackage will lookup files by specific names in the resource directory.
Default resource is JavaApp.png
Considered with application launchers registered for file associations and/or have an icon
Default resource is template.desktop
Default resource is unit-template.service
Default resource is template.spec
Default resource is template.control
Default resource is template.copyright
Default resource is template.preinstall
Default resource is template.prerm
Default resource is template.postinstall
Default resource is template.postrm
Default resource is JavaApp.ico
Default resource is WinLauncher.template
Default resource is main.wxs
Default resource is overrides.wxi
Considered if some application launchers are registered as background service-type applications
Considered if some application launchers are registered as background service-type applications
Default resource is service-install.wxi
Considered if some application launchers are registered as background service-type applications
Default resource is service-config.wxi
Default resource is InstallDirNotEmptyDlg.wxs
Default resource is ShortcutPromptDlg.wxs
Default resource is WinInstaller.template
Default resource is JavaApp.icns
Default resource is Info-lite.plist.template
Default resource is Runtime-Info.plist.template
Default resource is sandbox.plist
Considered if some application launchers are registered as background service-type applications
Default resource is uninstall.command.template
Default resource is preinstall.template
Default resource is postinstall.template
Considered if some application launchers are registered as background service-type applications
Default resource is services-preinstall.template
Considered if some application launchers are registered as background service-type applications
Default resource is services-postinstall.template
Default resource is background_pkg.png
Default resource is background_pkg.png
Default resource is product-def.plist
Default resource is launchd.plist.template
Default resource is DMGsetup.scpt
Default resource is lic_template.plist
Default resource is background_dmg.tiff
Default resource is JavaApp.icns