JPACKAGE(1)
π jpackage(1) β JDK Commands π
okay so welcome to the jpackage page, bestie β the manual name is JPACKAGE(1), and it lives under the JDK Commands umbrella. This is the packaging tool that makes self-contained Java apps happen, and we're going through every option with full main-character energy. π
β¨ NAME β¨
jpackage β tool for packaging self-contained Java applications.
π¦ SYNOPSIS π¦
jpackage [options]
options β Command-line options separated by spaces. See jpackage Options.
πΈ DESCRIPTION πΈ
Okay so 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, periodt. The tool will have options that allow packaged applications to be customized in various ways. π
π JPACKAGE OPTIONS π
All the options, all the lore, no skipping. Letβs go. π«Ά
π Generic Options π
@filenameβ Read options from a file. 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 this option is not specified a platform dependent default type will be created.--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. π¨οΈ--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 generated output file is placed. (absolute path or relative to the current directory). Defaults to the current working directory. π--resource-dirpath β Path to override jpackage resources. (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. π¨--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. If not specified, a temporary directory will be created and removed upon the task completion. π§Ή--vendorvendor β Vendor of the application.--verboseβ Enables verbose output. π--versionβ Print the product version to the output stream and exit.
π§ 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 tojlinkas the--add-moduleargument. If not specified, either just the main module (if--moduleis specified), or the default set of modules (if--main-jaris 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". 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-imageis not specified,jpackagewill runjlinkto create the runtime image using options specified by--jlink-options. πΌοΈ
π 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. π¦--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. π§Ί
π 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. π--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. 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--argumentsoption. β--main-classclass-name β Qualified name of the application main class to execute. This option can only be used if--main-jaris specified. π―--main-jarmain-jar β The main JAR of the application; containing the main class (specified as a path relative to the input path). Either--moduleor--main-jaroption can be specified but not both. π«--moduleor-mmodule-name[/main-class] β The main module (and optionally main class) of the application. 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--moduleor--main-jaroption can be specified but not both. π§±
π Platform dependent options for creating the application launcher π
π Windows platform options (available only when running on Windows) π
--win-consoleβ Creates a console launcher for the application, should be specified for application which requires console interactions. π₯οΈ
π macOS platform options (available only when running on macOS) π
--mac-package-identifieridentifier β An identifier that uniquely identifies the application for macOS. Defaults to the main class name. May only use alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters. πͺͺ--mac-package-namename β Name of the application as it appears in the Menu Bar. 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. π·οΈ--mac-package-signing-prefixprefix β When signing the application package, this value is 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 not specified, the standard keychains are used. π--mac-signing-key-user-namename β 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 file containing entitlements to use when signing executables and libraries in the bundle. π--mac-app-categorycategory β String used to constructLSApplicationCategoryTypein 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 is used to build an installable package (on all platforms) or to be signed (on macOS). (absolute path or relative to the current directory) πΌοΈ--file-associationspath β Path to a Properties file that contains 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. This option can be used multiple times. π--install-dirpath β Absolute path of the installation directory of the application (on macOS or linux), or 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). Option is required when creating a runtime installer. π§³--launcher-as-serviceβ asks for an installer that registers the main application launcher as a background service-type application. it's giving "runs quietly in the background like a little ghost" π»β¨
π» Platform dependent options for creating the application package
Windows platform options (available only when running on Windows): πͺ
--win-dir-chooserβ pops a dialog so the user can pick which directory the product gets installed into. literally letting them choose their own adventure π--win-help-url_url_ β the URL where the user can go get more info or actual technical support. no cap, this is the "help me help you" link π--win-menuβ requests a Start Menu shortcut for this application. classic, iconic, expected π--win-menu-group_menu-group-name_ β which Start Menu group this application gets placed in. gotta sit with its people fr fr πΈ--win-per-user-installβ requests that the install happen on a per-user basis. just for them, not for the whole machine π--win-shortcutβ requests a desktop shortcut for this application. main character energy on the desktop, as it should be β¨--win-shortcut-promptβ adds a dialog so the user chooses whether the installer creates shortcuts at all. consent first, always π«Ά--win-update-url_url_ β the URL of available application update information. future-you says ty π₯--win-upgrade-uuid_id_ β the UUID associated with upgrades for this package. the β¨identityβ¨ that lets the installer know it's the same app coming back for more π§
Linux platform options (available only when running on Linux): π§
--linux-package-name_name_ β the name for the Linux package.
defaults to the application name. (yes, it just reuses the app name if you don't say otherwise π)
--linux-deb-maintainer_email-address_ β the maintainer for the.debbundle. someone's gotta be the responsible adult π--linux-menu-group_menu-group-name_ β the menu group this application is placed in.--linux-package-deps_package-dep-string_ β the required packages or capabilities for the application. its little support system π«Ά--linux-rpm-license-type_type_ β the type of the license, i.e. the"License: value"of the RPM.spec. legal girlies rise π₯--linux-app-release_release_ β the release value of the RPM<name>.specfile, or the Debian revision value of the DEB control file. same field, two little worlds π--linux-app-category_category-value_ β the group value of the RPM<name>.specfile, or the Section value of the DEB control file. filing it under the right vibe check ποΈ--linux-shortcutβ creates a shortcut for the application. slay, give the people a door π
macOS platform options (available only when running on macOS): π
--mac-dmg-content_additional-content_[,_additional-content_...]β include all the referenced content in the dmg.
this option can be used more than once. stack 'em, bestie π
π JPACKAGE EXAMPLES
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. that's it, that's the whole guest list β no plus-ones π€
π JPACKAGE AND JLINK
jpackage will use jlink to create the Java Runtime unless the --runtime-image option is used. so like, either you hand it a runtime or it builds one itself β pick a lane, bestie π
the created Java Runtime image on Windows will include MS runtime libraries bundled with the JDK. no cap. but heads up: if MS runtime libraries of a different version are needed for the application, the user will need to add/replace those themselves. we do not do that for you, and we never claimed to ππ
πΈ JPACKAGE RESOURCE DIRECTORY πΈ
Okay bestie, so here's the tea on the resource directory β it's where you can over-ride all those icons, template files, and other resources that jpackage uses. Just drop your replacement resources into this directory, and jpackage will look up files by their specific names in the resource directory. Iconic behavior, honestly. π
π§ Resource directory files considered only when running on Linux π§
<launcher-name>.pngβ application launcher icon. The default resource isJavaApp.png. πΈ<launcher-name>.desktopβ a desktop file to be used with thexdg-desktop-menucommand. Considered when application launchers are registered for file associations and/or have an icon. The default resource istemplate.desktop. β¨
π¦ Resource directory files considered only when building Linux DEB/RPM installer π¦
<package-name>-<launcher-name>.serviceβ systemd unit file for an application launcher registered as a background service-type application. The default resource isunit-template.service. π οΈ
π Resource directory files considered only when building Linux RPM installer π
<package-name>.specβ RPM spec file. The default resource istemplate.spec. π
π Resource directory files considered only when building Linux DEB installer π
controlβ control file. The default resource istemplate.control. πcopyrightβ copyright file. The default resource istemplate.copyright. πpreinstallβ pre-install shell script. The default resource istemplate.preinstall. πprermβ pre-remove shell script. The default resource istemplate.prerm. ποΈpostinstallβ post-install shell script. The default resource istemplate.postinstall. βpostrmβ post-remove shell script. The default resource istemplate.postrm. π§Ή
πͺ Resource directory files considered only when running on Windows πͺ
<launcher-name>.icoβ application launcher icon. The default resource isJavaApp.ico. πͺ<launcher-name>.propertiesβ properties file for the application launcher executable. The default resource isWinLauncher.template. π
π 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β main WiX project file. The default resource ismain.wxs. π¦overrides.wxiβ overrides WiX project file. The default resource isoverrides.wxi. π§service-installer.exeβ service installer executable. Considered if some application launchers are registered as background service-type applications. βοΈ<launcher-name>-service-install.wxiβ service installer WiX project file. Considered if some application launchers are registered as background service-type applications. The default resource isservice-install.wxi. π οΈ<launcher-name>-service-config.wxiβ service installer WiX project file. Considered if some application launchers are registered as background service-type applications. The default resource isservice-config.wxi. βοΈInstallDirNotEmptyDlg.wxsβ WiX project file for the installer UI dialog that checks the installation directory doesn't exist or is empty. The default resource isInstallDirNotEmptyDlg.wxs. π§ShortcutPromptDlg.wxsβ WiX project file for the installer UI dialog that configures shortcuts. The default resource isShortcutPromptDlg.wxs. πbundle.wxfβ WiX project file with the hierarchy of components of the application image. π§©ui.wxfβ WiX project file for the installer UI. π₯οΈos-condition.wxfβ WiX project file with the condition to block installation on older versions of Windows. The default resource isos-condition.wxf. βwix-conv.xslβ WiX source code converter. Used for converting WiX sources from WiX v3 to v4 schema when WiX v4 or newer is used. The default resource iswix3-to-wix4-conv.xsl. π
π₯ Resource directory files considered only when building Windows EXE installer π₯
WinInstaller.propertiesβ properties file for the installer executable. The default resource isWinInstaller.template. π<package-name>-post-msi.wsfβ a Windows Script File (WSF) to run after building the embedded MSI installer for the EXE installer. π―installer.exeβ executable wrapper for the MSI installer. The default resource ismsiwrapper.exe. π
π Resource directory files considered only when running on macOS π
<launcher-name>.icnsβ application launcher icon. The default resource isJavaApp.icns. πInfo.plistβ application property list file. The default resource isInfo-lite.plist.template. πRuntime-Info.plistβ Java Runtime property list file. The default resource isRuntime-Info.plist.template. β<application-name>.entitlementsβ signing entitlements property list file. The default resource issandbox.plist. π
π Resource directory files considered only when building macOS PKG/DMG installer π
<package-name>-post-image.shβ shell script to run after building the application image. π
π Resource directory files considered only when building macOS PKG installer π
uninstallerβ uninstaller shell script. Considered if some application launchers are registered as background service-type applications. The default resource isuninstall.command.template. ποΈpreinstallβ pre-install shell script. The default resource ispreinstall.template. πpostinstallβ post-install shell script. The default resource ispostinstall.template. βservices-preinstallβ pre-install shell script for the services package. Considered if some application launchers are registered as background service-type applications. The default resource isservices-preinstall.template. βοΈservices-postinstallβ post-install shell script for the services package. Considered if some application launchers are registered as background service-type applications. The default resource isservices-postinstall.template. π οΈ<package-name>-background.pngβ background image. The default resource isbackground_pkg.png. πΌοΈ<package-name>-background-darkAqua.pngβ dark background image. The default resource isbackground_pkg.png. πproduct-def.plistβ package property list file. The default resource isproduct-def.plist. π¦<package-name>-<launcher-name>.plistβ launchd property list file for an application launcher registered as a background service-type application. The default resource islaunchd.plist.template. π
π¦ Resource directory files considered only when building macOS DMG installer π¦
<package-name>-dmg-setup.scptβ setup AppleScript script. The default resource isDMGsetup.scpt. π<package-name>-license.plistβ license property list file. The default resource islic_template.plist. π<package-name>-background.tiffβ background image. The default resource isbackground_dmg.tiff. πΌοΈ<package-name>-volume.icnsβ volume icon. The default resource isJavaApp.icns. πΏ
And that's the whole resource directory, bestie! This page is from JDK 25.0.5.0.3, dated 2026, and it's the JPACKAGE(1) manual page. Slay forever. πβ¨
π¦ where this page comes from
- arch rolling: jdk25-openjdk 25.0.5.0.3.u1-1 Β· LicenseRef-Java
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms