1JPACKAGE(1) JDK Commands JPACKAGE(1)
2
3
4
6 jpackage - tool for packaging self-contained Java applications.
7
9 jpackage [options]
10
11 options
12 Command-line options separated by spaces. See jpackage Options.
13
15 The jpackage tool will take as input a Java application and a Java
16 run-time image, and produce a Java application image that includes all
17 the necessary dependencies. It will be able to produce a native pack‐
18 age in a platform-specific format, such as an exe on Windows or a dmg
19 on macOS. Each format must be built on the platform it runs on, there
20 is no cross-platform support. The tool will have options that allow
21 packaged applications to be customized in various ways.
22
24 Generic Options:
25 @filename
26 Read options from a file.
27
28 This option can be used multiple times.
29
30 --type or -t <type string>
31 The type of package to create
32
33 Valid values are: {"app-image", "exe", "msi", "rpm", "deb",
34 "pkg", "dmg"}
35
36 If this option is not specified a platform dependent default
37 type will be created.
38
39 --app-version <version>
40 Version of the application and/or package
41
42 --copyright <copyright string>
43 Copyright for the application
44
45 --description <description string>
46 Description of the application
47
48 --help or -h
49 Print the usage text with a list and description of each valid
50 option for the current platform to the output stream, and exit.
51
52 --icon <icon file path>
53 Path of the icon of the application package (absolute path or
54 relative to the current directory)
55
56 --name or -n <name>
57 Name of the application and/or package
58
59 --dest or -d <output path>
60 Path where generated output file is placed
61
62 Defaults to the current working directory. (absolute path or
63 relative to the current directory).
64
65 --temp <directory path>
66 Path of a new or empty directory used to create temporary files
67 (absolute path or relative to the current directory)
68
69 If specified, the temp dir will not be removed upon the task
70 completion and must be removed manually.
71
72 If not specified, a temporary directory will be created and re‐
73 moved upon the task completion.
74
75 --vendor <vendor string>
76 Vendor of the application
77
78 --verbose
79 Enables verbose output.
80
81 --version
82 Print the product version to the output stream and exit.
83
84 Options for creating the runtime image:
85 --add-modules <module name> [,<module name>...]
86 A comma (",") separated list of modules to add
87
88 This module list, along with the main module (if specified) will
89 be passed to jlink as the --add-module argument. If not speci‐
90 fied, either just the main module (if --module is specified), or
91 the default set of modules (if --main-jar is specified) are
92 used.
93
94 This option can be used multiple times.
95
96 --module-path or -p <module path>...
97 A File.pathSeparator separated list of paths
98
99 Each path is either a directory of modules or the path to a mod‐
100 ular jar, and is absolute or relative to the current directory.
101
102 This option can be used multiple times.
103
104 --jlink-options <jlink options>
105 A space separated list of options to pass to jlink
106
107 If not specified, defaults to "--strip-native-commands
108 --strip-debug --no-man-pages --no-header-files"
109
110 This option can be used multiple times.
111
112 --runtime-image <directory path>
113 Path of the predefined runtime image that will be copied into
114 the application image (absolute path or relative to the current
115 directory)
116
117 If --runtime-image is not specified, jpackage will run jlink to
118 create the runtime image using options specified by --jlink-op‐
119 tions.
120
121 Options for creating the application image:
122 --input or -i <input path>
123 Path of the input directory that contains the files to be pack‐
124 aged (absolute path or relative to the current directory)
125
126 All files in the input directory will be packaged into the ap‐
127 plication image.
128
129 Options for creating the application launcher(s):
130 --add-launcher <launcher name>=<file path>
131 Name of launcher, and a path to a Properties file that contains
132 a list of key, value pairs (absolute path or relative to the
133 current directory)
134
135 The keys "module", "main-jar", "main-class", "arguments", "ja‐
136 va-options", "app-version", "icon", "linux-app-category", "lin‐
137 ux-app-release", and "win-console" can be used.
138
139 These options are added to, or used to overwrite, the original
140 command line options to build an additional alternative launch‐
141 er. The main application launcher will be built from the com‐
142 mand line options. Additional alternative launchers can be
143 built using this option, and this option can be used multiple
144 times to build multiple additional launchers.
145
146 --arguments <main class arguments>
147 Command line arguments to pass to the main class if no command
148 line arguments are given to the launcher
149
150 This option can be used multiple times.
151
152 --java-options <java options>
153 Options to pass to the Java runtime
154
155 This option can be used multiple times.
156
157 --main-class <class name>
158 Qualified name of the application main class to execute
159
160 This option can only be used if --main-jar is specified.
161
162 --main-jar <main jar file>
163 The main JAR of the application; containing the main class
164 (specified as a path relative to the input path)
165
166 Either --module or --main-jar option can be specified but not
167 both.
168
169 --module or -m <module name>/<main class>]
170 The main module (and optionally main class) of the application
171
172 This module must be located on the module path.
173
174 When this option is specified, the main module will be linked in
175 the Java runtime image. Either --module or --main-jar option
176 can be specified but not both.
177
178 Platform dependent option for creating the application launcher:
179 Windows platform options (available only when running on Windows):
180 --win-console
181 Creates a console launcher for the application, should be speci‐
182 fied for application which requires console interactions
183
184 macOS platform options (available only when running on macOS):
185 --mac-package-identifier <ID string>
186 An identifier that uniquely identifies the application for macOS
187
188 Defaults to the the main class name.
189
190 May only use alphanumeric (A-Z,a-z,0-9), hyphen (-), and period
191 (.) characters.
192
193 --mac-package-name <name string>
194 Name of the application as it appears in the Menu Bar
195
196 This can be different from the application name.
197
198 This name must be less than 16 characters long and be suitable
199 for displaying in the menu bar and the application Info window.
200 Defaults to the application name.
201
202 --mac-package-signing-prefix <prefix string>
203 When signing the application package, this value is prefixed to
204 all components that need to be signed that don't have an exist‐
205 ing package identifier.
206
207 --mac-sign
208 Request that the bundle be signed.
209
210 --mac-signing-keychain <keychain name>
211 Name of the keychain to search for the signing identity
212
213 If not specified, the standard keychains are used.
214
215 --mac-signing-key-user-name <team name>
216 Team or user name portion in Apple signing identities
217
218 --mac-app-store
219 Indicates that the jpackage output is intended for the Mac App
220 Store.
221
222 --mac-entitlements <file path>
223 Path to file containing entitlements to use when signing exe‐
224 cutables and libraries in the bundle
225
226 --mac-app-category <category string>
227 String used to construct LSApplicationCategoryType in applica‐
228 tion plist
229
230 The default value is "utilities".
231
232 Options for creating the application package:
233 --about-url <url>
234 URL of the application's home page
235
236 --app-image <directory path>
237 Location of the predefined application image that is used to
238 build an installable package
239
240 (absolute path or relative to the current directory).
241
242 See create-app-image mode options to create the application im‐
243 age.
244
245 --file-associations <file path>
246 Path to a Properties file that contains list of key, value pairs
247 (absolute path or relative to the current directory)
248
249 The keys "extension", "mime-type", "icon", and "description" can
250 be used to describe the association.
251
252 This option can be used multiple times.
253
254 --install-dir <directory path>
255 Absolute path of the installation directory of the application
256 (on macos or linux), or relative sub-path of the installation
257 directory such as "Program Files" or "AppData" (on Windows)
258
259 --license-file <file path>
260 Path to the license file (absolute path or relative to the cur‐
261 rent directory)
262
263 --resource-dir <directory path>
264 Path to override jpackage resources (absolute path or relative
265 to the current directory)
266
267 Icons, template files, and other resources of jpackage can be
268 over-ridden by adding replacement resources to this directory.
269
270 --runtime-image <directory path>
271 Path of the predefined runtime image to install (absolute path
272 or relative to the current directory)
273
274 Option is required when creating a runtime installer.
275
276 Platform dependent options for creating the application package:
277 Windows platform options (available only when running on Windows):
278 --win-dir-chooser
279 Adds a dialog to enable the user to choose a directory in which
280 the product is installed.
281
282 --win-help-url <url>
283 URL where user can obtain further information or technical sup‐
284 port
285
286 --win-menu
287 Request to add a Start Menu shortcut for this application
288
289 --win-menu-group <menu group name>
290 Start Menu group this application is placed in
291
292 --win-per-user-install
293 Request to perform an install on a per-user basis
294
295 --win-shortcut
296 Request to create a desktop shortcut for this application
297
298 --win-shortcut-prompt
299 Adds a dialog to enable the user to choose if shortcuts will be
300 created by installer
301
302 --win-update-url <url>
303 URL of available application update information
304
305 --win-upgrade-uuid <id string>
306 UUID associated with upgrades for this package
307
308 Linux platform options (available only when running on Linux):
309 --linux-package-name <package name>
310 Name for Linux package
311
312 Defaults to the application name.
313
314 --linux-deb-maintainer <email address>
315 Maintainer for .deb bundle
316
317 --linux-menu-group <menu-group-name>
318 Menu group this application is placed in
319
320 --linux-package-deps
321 Required packages or capabilities for the application
322
323 --linux-rpm-license-type <type string>
324 Type of the license ("License: <value>" of the RPM .spec)
325
326 --linux-app-release <release string>
327 Release value of the RPM <name>.spec file or Debian revision
328 value of the DEB control file
329
330 --linux-app-category <category string>
331 Group value of the RPM <name>.spec file or Section value of DEB
332 control file
333
334 --linux-shortcut
335 Creates a shortcut for the application.
336
338 Generate an application package suitable for the host system:
339
340 For a modular application:
341 jpackage -n name -p modulePath -m moduleName/className
342 For a non-modular application:
343 jpackage -i inputDir -n name \
344 --main-class className --main-jar myJar.jar
345 From a pre-built application image:
346 jpackage -n name --app-image appImageDir
347
348 Generate an application image:
349
350 For a modular application:
351 jpackage --type app-image -n name -p modulePath \
352 -m moduleName/className
353 For a non-modular application:
354 jpackage --type app-image -i inputDir -n name \
355 --main-class className --main-jar myJar.jar
356 To provide your own options to jlink, run jlink separately:
357 jlink --output appRuntimeImage -p modulePath \
358 --add-modules moduleName \
359 --no-header-files [<additional jlink options>...]
360 jpackage --type app-image -n name \
361 -m moduleName/className --runtime-image appRuntimeImage
362
363 Generate a Java runtime package:
364
365 jpackage -n name --runtime-image <runtime-image>
366
367
368
369JDK 17 2021 JPACKAGE(1)