JPACKAGE(1)
π jpackage(1) π
okay bestie, welcome to jpackage(1) β she lives in the JDK Commands section of the manual and she is, like, the main character of getting your Java app out into the world. buckle up π
β¨ NAME β¨
jpackage β tool for packaging self-contained Java applications. that's her whole thing. no cap.
π¦ SYNOPSIS π¦
jpackage [options]
- options β command-line options, separated by spaces. (the full list is in jpackage Options below, keep scrolling, it's a lot π)
π DESCRIPTION π
so here's the vibe: the jpackage tool takes a Java application and a Java run-time image as input, and produces a Java application image that includes all the necessary dependencies. everything's in there. self-contained. iconic. π
it can also produce a native package in a platform-specific format β think an exe on Windows, or a dmg on macOS. slay.
β οΈ but listen: each format must be built on the platform it runs on. there is no cross-platform support. you can't make a Windows exe from your Mac, that's not a thing, don't try it π
and the tool has options that let packaged applications be customized in various ways. a lot of options, actually. brace yourself π«Ά
π JPACKAGE OPTIONS π
π Generic Options π
@filenameβ read options from a file. yes, a whole file of options. this option can be used multiple times. π--typeor-ttype β the type of package to create.
Valid values are: {"app-image", "exe", "msi", "rpm", "deb", "pkg", "dmg"}
if you don't specify this option, a platform dependent default type will be created. she'll pick for you β¨
--app-versionversion β version of the application and/or package.--copyrightcopyright β copyright for the application.--descriptiondescription β description of the application.--helpor-hβ print the usage text, with a list and description of each valid option for the current platform, to the output stream, and exit. very "lemme show you around first" of her π«Ά--iconpath β path of the icon of the application package.
(absolute path or relative to the current directory)
--nameor-nname β name of the application and/or package.--destor-ddestination β path where the generated output file is placed.
(absolute path or relative to the current directory)
defaults to the current working directory. π
--resource-dirpath β path to overridejpackageresources.
(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. swappable assets, we love to see it π
--tempdirectory β path of a new or empty directory used to create temporary files.
(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. you've been warned, bestie β that's on you now π
if not specified, a temporary directory will be created and removed upon the task completion. clean girl behaviour β¨
--vendorvendor β vendor of the application.--verbose <[-]key(,[-]key)*>β configures verbose output. enables and/or disables log message categories using zero or more of the keys described below, separated by commas. the keyallenables or disables all categories (respectively); other keys enable the corresponding category, or disable it if preceded by a hyphen (-).
supported values for key are:
all: enables console output and routing of all message categories to the logging framework through theSystem.LoggerAPI. equivalent toconsole,log.console: enables console output of all message categories. equivalent toall,-log.errors: enables output of fatal errors. if the key is specified without thetracekey, error messages will be written to the console without the corresponding exception stacktraces. if the key is specified with thetracekey, error messages will be written to the console with the corresponding exception stacktraces.progress: enables output of progress messages.resources: enables output of messages about the use of the configurable resources.summary: enables output of the bundle properties and the versions of the tools being used.tools: enables output of commands being executed. if the key is specified without thetracekey, thejpackagewill print the command lines without the output produced by executing these command lines. only command lines that are relevant to package customization will be written to the console. if the key is specified with thetracekey, thejpackagewill print all command lines and their output.trace: enables output of stack traces of suppressed exceptions and details of thejpackageexecution. when combined with other keys, it enables additional information in messages from the corresponding message categories, as described above.warning: enables output of warnings.log: enables routing of all message categories to the logging framework through theSystem.LoggerAPI. the logger name will be"jdk.jpackage".
if the option is specified without the value, it is equivalent to:
--verbose console,-trace
if the option is not specified, it is equivalent to:
--verbose errors,warnings
sample usage:
suppress all console output, enable logging via the System.Logger API:
--verbose log
enable all message categories in the console:
--verbose console
enable all message categories, but "trace" and "tools" in the console:
--verbose console,-trace,-tools
enable "trace" and "tools" message categories in the console:
--verbose trace,tools
enable "trace" and "tools" message categories in the console and enable logging via the System.Logger API:
--verbose log,trace,tools
π₯ like, the control you have here? unmatched.
--versionβ print the product version to the output stream and exit. quick little flex, then she's out π¨
π§ Options for creating the runtime image π§
--add-modulesmodule-name[,module-name...]β a comma (",") separated list of modules to add.
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. π
--module-pathor-pmodule-path[,module-path...]β aFile.pathSeparatorseparated list of paths.
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.
--jlink-optionsoptions β a space separated list of options to pass tojlink.
if not specified, defaults to "--strip-native-commands --strip-debug --no-man-pages --no-header-files" β those are the defaults, don't come for me, that's just what it says π«Ά
this option can be used multiple times.
--runtime-imagedirectory β path of the predefined runtime image that will be copied into the application image.
(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. so either you bring the runtime or she builds one, no third option β¨
πΈ Options for creating the application image πΈ
--inputor-idirectory β path of the input directory that contains the files to be packaged.
(absolute path or relative to the current directory)
all files in the input directory will be packaged into the application image. all of them. everything. no skipping π
--app-contentadditional-content[,additional-content...]β a comma separated list of paths to files and/or directories to add to the application payload.
this option can be used more than once.
π macOS note: the value should be a directory with the"Resources"subdirectory (or any other directory that is valid in the"Contents"directory of the application bundle). otherwise,jpackagemay produce an invalid application bundle which may fail code signing and/or notarization. seriously, don't skip this part π
π Options for creating the application launcher(s) π
--add-launchername=path β name of launcher, and a path to a Properties file that contains a list of key, value pairs.
(absolute path or relative to the current directory)
the keys "module", "main-jar", "main-class", "description", "arguments", "java-options", "icon", "launcher-as-service", "win-console", "win-shortcut", "win-menu", 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. launcher girlies rise π
--argumentsarguments β command line arguments to pass to the main class if no command line arguments are given to the launcher.
this option can be used multiple times.
value can contain substrings that will be expanded at runtime. two types of such substrings are supported: environment variables and "APPDIR", "BINDIR", and "ROOTDIR" tokens.
an expandable substring should be enclosed between the dollar sign character ($) and the first following non-alphanumeric character. alternatively, it can be enclosed between "${" and "}" substrings.
expandable substrings are case-sensitive on Unix and case-insensitive on Windows. no string expansion occurs if the referenced environment variable is undefined.
environment variables with names "APPDIR", "BINDIR", and "ROOTDIR" will be ignored, and these expandable substrings will be replaced by values calculated by the app launcher. so don't try to sneak those in, she handles them π
prefix the dollar sign character with the backslash character (\) to prevent substring expansion.
--java-optionsoptions β options to pass to the Java runtime.
this option can be used multiple times.
value can contain substrings that will be substituted at runtime, such as for the --arguments option. same energy, different flag β¨
--main-classclass-name β qualified name of the application main class to execute.
β οΈ this option can only be used if--main-jaris specified. no--main-jar, no--main-class, that's the rule π«Ά
--main-jarmain-jar β the main JAR of the application; containing the main class (specified as a path relative to the input path).
β¦and yeah, --module and --main-jar are like the two friends who can't both come to the party β either one or the other, never both π
--module,-mmodule-name[/main-class] β the main module (and optionally the main class too) of your app π«Ά this module has to live on the module path, no exceptions. When you use this option, the main module gets linked right into the Java runtime image. And remember the rule from above:--moduleor--main-jar, pick one, not both β¨
π Platform dependent options for creating the application launcher:
πͺ Windows platform options (only a thing when you're running on Windows):
--win-consoleβ makes a console launcher for your app. Lowkey you want this if your application actually needs console interactions, i.e. it talks back in a terminal π»
π macOS platform options (only a thing when you're running on macOS):
--mac-package-identifieridentifier β an identifier that uniquely identifies your application for macOS. Defaults to the main class name. You may only use alphanumeric characters (A-Z,a-z,0-9), hyphen (-), and period (.) β anything else is a no π--mac-package-namename β the name of the application as it shows up in the Menu Bar. This can totally be different from the application name itself. It must be less than 16 characters long and has to be suitable for displaying in the menu bar and the application Info window. Defaults to the application name π--mac-package-signing-prefixprefix β when signing the application package, this value gets prefixed to all components that need to be signed that don't have an existing package identifier βοΈ--mac-signβ request that the package or the predefined application image be signed β¨--mac-signing-keychainkeychain-name β name of the keychain to search for the signing identity π if you don't specify it, the standard keychains get used.--mac-signing-key-user-namename β the team or user name portion in Apple signing identities π--mac-app-storeβ indicates that the jpackage output is intended for the Mac App Store ποΈ--mac-entitlementspath β path to the file containing entitlements to use when signing executables and libraries in the bundle π--mac-app-categorycategory β string used to constructLSApplicationCategoryTypein the application plist. The default value is"utilities"π§°
π¦ Options for creating the application package:
--about-urlurl β URL of the application's home page π--app-imagedirectory β location of the predefined application image that's used to build an installable package (on all platforms) or to be signed (on macOS). It's an absolute path or relative to the current directory π--file-associationspath β path to a Properties file that contains a list of key, value pairs (absolute path or relative to the current directory). The keys"extension","mime-type","icon", and"description"can be used to describe the association. You can use this option multiple times, bestie π--install-dirpath β absolute path of the installation directory of the application (on macOS or linux), or a relative sub-path of the installation directory such as"Program Files"or"AppData"(on Windows) π--license-filepath β path to the license file (absolute path or relative to the current directory) π--runtime-imagepath β path of the predefined runtime image to install (absolute path or relative to the current directory). This option is required when you're creating a runtime installer β οΈ--launcher-as-serviceβ request to create an installer that will register the main application launcher as a background service-type application π
π§© Platform dependent options for creating the application package:
πͺ Windows platform options (only a thing when you're running on Windows):
--win-dir-chooserβ adds a dialog so the user can choose a directory to install the product in ποΈ--win-help-urlurl β URL where the user can get further information or technical support π--win-menuβ adds a Start menu shortcut for this application, or requests to do so if--win-shortcut-promptis specified πͺ--win-menu-groupmenu-group-name β the Start Menu group this application gets placed in π--win-per-user-installβ installs the application on a per-user basis. Without this option it installs per-machine π€ vs π₯οΈ--win-shortcutβ adds a desktop shortcut for this application, or requests to do so if--win-shortcut-promptis specified β¨--win-shortcut-promptβ adds a dialog if at least one of--win-menuor--win-shortcutare specified, so the user can choose whether these shortcuts get created by the installer π¬--win-update-urlurl β URL of available application update information π--win-upgrade-uuidid β UUID associated with upgrades for this package π--win-with-uiβ forces the installer to have UI πΌοΈ
π§ Linux platform options (only a thing when you're running on Linux):
--linux-package-namename β name for the Linux package. Defaults to the application name π§--linux-deb-maintaineremail-address β maintainer for the.debbundle π§--linux-menu-groupmenu-group-name β the menu group this application gets placed in π--linux-package-depspackage-dep-string β required packages or capabilities for the application π§--linux-rpm-license-typetype β type of the license ("License: value"of the RPM.spec) π--linux-app-releaserelease β release value of the RPM<name>.specfile or Debian revision value of the DEB control file π’--linux-app-categorycategory-value β group value of the RPM<name>.specfile or Section value of the DEB control file π·οΈ--linux-shortcutβ creates a shortcut for the application π―
π macOS platform options (only a thing when you're running on macOS):
--mac-dmg-contentadditional-content [,additional-content...] β include all the referenced content in the dmg. You can use this option more than once π½
π JPACKAGE EXAMPLES
Ok bestie, here's where it gets fun β actual copy-pasteable vibes β¨
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 π don't try to sneak anything else in there, it's not gonna slay.
π¦ JPACKAGE AND JLINK
So here's the tea β β jpackage will use jlink to create the Java Runtime unless you use the --runtime-image option. And the created Java Runtime image on Windows will include MS runtime libraries bundled with the JDK πͺ
But if MS runtime libraries of a different version are needed for the application, the user will need to add/replace those themselves π no cap, that part's on you.
π JPACKAGE RESOURCE DIRECTORY π
Okay so bestie, you can override jpackage's icons, template files, and other resources by adding replacement resources to this directory. jpackage looks up files by specific names in the resource directory β literally the names matter, no cap. β¨
π§ Resource directory files considered only when running on Linux:
<launcher-name>.pngβ the application launcher icon. πΌοΈ- Default resource is
JavaApp.png.
- Default resource is
<launcher-name>.desktopβ a desktop file to be used with thexdg-desktop-menucommand.- Considered with application launchers registered for file associations and/or have an icon.
- Default resource is
template.desktop.
π¦ Resource directory files considered only when building Linux DEB/RPM installer:
<package-name>-<launcher-name>.serviceβ asystemdunit file for an application launcher registered as a background service-type application.- Default resource is
unit-template.service.
- Default resource is
π§ Resource directory files considered only when building Linux RPM installer:
<package-name>.specβ an RPM spec file.- Default resource is
template.spec.
- Default resource is
π§ Resource directory files considered only when building Linux DEB installer:
controlβ the control file.- Default resource is
template.control.
- Default resource is
copyrightβ the copyright file.- Default resource is
template.copyright.
- Default resource is
preinstallβ a pre-install shell script.- Default resource is
template.preinstall.
- Default resource is
prermβ a pre-remove shell script.- Default resource is
template.prerm.
- Default resource is
postinstallβ a post-install shell script.- Default resource is
template.postinstall.
- Default resource is
postrmβ a post-remove shell script.- Default resource is
template.postrm.
- Default resource is
πͺ Resource directory files considered only when running on Windows:
<launcher-name>.icoβ the application launcher icon. πͺ- Default resource is
JavaApp.ico.
- Default resource is
<launcher-name>.propertiesβ a properties file for the application launcher executable.- Default resource is
WinLauncher.template.
- Default resource is
πͺ Resource directory files considered only when building Windows MSI/EXE installer:
<application-name>-post-image.wsfβ a Windows Script File (WSF) to run after building the application image.main.wxsβ the main WiX project file.- Default resource is
main.wxs.
- Default resource is
overrides.wxiβ the overrides WiX project file.- Default resource is
overrides.wxi.
- Default resource is
service-installer.exeβ the service installer executable.- Considered if some application launchers are registered as background service-type applications.
<launcher-name>-service-install.wxiβ a service installer WiX project file.- Considered if some application launchers are registered as background service-type applications.
- Default resource is
service-install.wxi.
<launcher-name>-service-config.wxiβ a service installer WiX project file.- Considered if some application launchers are registered as background service-type applications.
- Default resource is
service-config.wxi.
InstallDirNotEmptyDlg.wxsβ a WiX project file for the installer UI dialog that checks the installation directory doesn't exist or is empty.- Default resource is
InstallDirNotEmptyDlg.wxs.
- Default resource is
ShortcutPromptDlg.wxsβ a WiX project file for the installer UI dialog that configures shortcuts.- Default resource is
ShortcutPromptDlg.wxs.
- Default resource is
bundle.wxfβ a WiX project file with the hierarchy of components of the application image.ui.wxfβ a WiX project file for the installer UI.os-condition.wxfβ a WiX project file with the condition to block installation on older versions of Windows.- Default resource is
os-condition.wxf.
- Default resource is
wix-conv.xslβ a WiX source code converter. It's used for converting WiX sources from WiX v3 to v4 schema when WiX v4 or newer is used.- Default resource is
wix3-to-wix4-conv.xsl.
- Default resource is
πͺ Resource directory files considered only when building Windows EXE installer:
WinInstaller.propertiesβ a properties file for the installer executable.- Default resource is
WinInstaller.template.
- Default resource is
<package-name>-post-msi.wsfβ a Windows Script File (WSF) to run after building the embedded MSI installer for the EXE installer.installer.exeβ an executable wrapper for the MSI installer.- Default resource is
msiwrapper.exe.
- Default resource is
π Resource directory files considered only when running on macOS:
<launcher-name>.icnsβ the application launcher icon. π- Default resource is
JavaApp.icns.
- Default resource is
Info.plistβ the application property list file.- Default resource is
Info-lite.plist.template.
- Default resource is
Runtime-Info.plistβ the Java Runtime property list file.- Default resource is
Runtime-Info.plist.template.
- Default resource is
<application-name>.entitlementsβ the signing entitlements property list file.- Default resource is
sandbox.plist.
- Default resource is
π Resource directory files considered only when building macOS PKG/DMG installer:
<package-name>-post-image.shβ a shell script to run after building the application image.
π Resource directory files considered only when building macOS PKG installer:
uninstallerβ the uninstaller shell script.- Considered if some application launchers are registered as background service-type applications.
- Default resource is
uninstall.command.template.
preinstallβ a pre-install shell script.- Default resource is
preinstall.template.
- Default resource is
postinstallβ a post-install shell script.- Default resource is
postinstall.template.
- Default resource is
services-preinstallβ a pre-install shell script for the services package.- Considered if some application launchers are registered as background service-type applications.
- Default resource is
services-preinstall.template.
services-postinstallβ a post-install shell script for the services package.- Considered if some application launchers are registered as background service-type applications.
- Default resource is
services-postinstall.template.
<package-name>-background.pngβ the background image.- Default resource is
background_pkg.png.
- Default resource is
<package-name>-background-darkAqua.pngβ the dark background image.- Default resource is
background_pkg.png.
- Default resource is
product-def.plistβ the package property list file.- Default resource is
product-def.plist.
- Default resource is
<package-name>-<launcher-name>.plistβ alaunchdproperty list file for an application launcher registered as a background service-type application.- Default resource is
launchd.plist.template.
- Default resource is
π Resource directory files considered only when building macOS DMG installer:
<package-name>-dmg-setup.scptβ the setup AppleScript script.- Default resource is
DMGsetup.scpt.
- Default resource is
<package-name>-license.plistβ the license property list file.- Default resource is
lic_template.plist.
- Default resource is
<package-name>-background.tiffβ the background image.- Default resource is
background_dmg.tiff.
- Default resource is
<package-name>-volume.icnsβ the volume icon.- Default resource is
JavaApp.icns.
- Default resource is
That's a wrap on the resource directory era, bestie. π This page is from JDK 27-ea, dated 2026 β and the footer says JPACKAGE(1). Mwah. π
π¦ where this page comes from
- epel 10: java-latest-openjdk-devel 1:27.0.0.0.35-0.0.1.0.ea.el10_3 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
- epel 10: java-latest-openjdk-devel-fastdebug 1:27.0.0.0.35-0.0.1.0.ea.el10_3 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
- epel 10: java-latest-openjdk-devel-slowdebug 1:27.0.0.0.35-0.0.1.0.ea.el10_3 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
- epel 9: java-latest-openjdk-devel 1:27.0.0.0.35-0.0.1.0.ea.el9 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
- epel 9: java-latest-openjdk-devel-fastdebug 1:27.0.0.0.35-0.0.1.0.ea.el9 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
- epel 9: java-latest-openjdk-devel-slowdebug 1:27.0.0.0.35-0.0.1.0.ea.el9 Β· Apache-1.1 AND Apache-2.0 AND LicenseRef-Callaway-BSD AND LicenseRef-Callaway-BSD-with-advertising AND GPL-1.0-or-later AND GPL-2.0-only AND LicenseRef-Callaway-GPLv2-with-exceptions AND IJG AND LicenseRef-Callaway-LGPLv2+ AND LicenseRef-Callaway-MIT AND MPL-2.0 AND LicenseRef-Callaway-Public-Domain AND W3C AND Zlib AND ISC AND FTL AND LicenseRef-RSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms