1javapackager(1) Java Deployment Tools javapackager(1)
2
3
4
6 javapackager - Performs tasks related to packaging and signing Java and
7 JavaFX applications.
8
10 javapackager command [options]
11
12 command
13 The task that should be performed.
14
15 options
16 One or more options for the command separated by spaces.
17
19 You can specify one of the following commands. After the command,
20 specify the options for it.
21
22 -createbss
23 Converts CSS files into binary form.
24
25 -createjar
26 Produces a JAR archive according to other parameters.
27
28 -deploy
29 Assembles the application package for redistribution. By default,
30 the deploy task generates the base application package, but it can
31 also generate a self-contained application package if requested.
32
33 -makeall
34 Performs compilation, createjar, and deploy steps as one call, with
35 most arguments predefined, and attempts to generate all applicable
36 self-contained application packages. The source files must be
37 located in a folder called src, and the resulting files (JAR, JNLP,
38 HTML, and self-contained application packages) are put in a folder
39 called dist. This command can only be configured in a minimal way
40 and is as automated as possible.
41
42 -signjar
43 Signs JAR file(s) with a provided certificate.
44
46 -outdir dir
47 Name of the directory that will receive generated output files.
48
49 -srcdir dir
50 Base directory of the files to package.
51
52 -srcfiles files
53 List of files in the directory specified by the -srcdir option. If
54 omitted, all files in the directory (which is a mandatory argument
55 in this case) will be used. Files in the list must be separated by
56 spaces.
57
59 -appclass app-class
60 Qualified name of the application class to be executed.
61
62 -argument arg
63 An unnamed argument to be inserted into the JNLP file as an
64 <fx:argument> element.
65
66 -classpath files
67 List of dependent JAR file names.
68
69 -manifestAttrs manifest-attributes
70 List of names and values for additional manifest attributes.
71 Syntax:
72
73 "name1=value1,name2=value2,name3=value3"
74
75
76 -nocss2bin
77 The packager will not convert CSS files to binary form before
78 copying to JAR.
79
80 -outdir dir
81 Name of the directory that will receive generated output files.
82
83 -outfile filename
84 Name (without the extension) of the file that will be generated.
85
86 -paramfile file
87 A properties file with default named application parameters.
88
89 -preloader preloader-class
90 Qualified name of the JavaFX preloader class to be executed. Use
91 this option only for JavaFX applications. Do not use for Java
92 applications, including headless applications.
93
94 -srcdir dir
95 Base directory of the files to package.
96
97 -srcfiles files
98 List of files in the directory specified by the -srcdir option. If
99 omitted, all files in the directory (which is a mandatory argument
100 in this case) will be used. Files in the list must be separated by
101 spaces.
102
104 -allpermissions
105 If present, the application will require all security permissions
106 in the JNLP file.
107
108 -appclass app-class
109 Qualified name of the application class to be executed.
110
111 -argument arg
112 An unnamed argument to be inserted into an <fx:argument> element in
113 the JNLP file.
114
115 -Bbundler-argument=value
116 Provides information to the bundler that is used to package a
117 self-contained application. See Arguments for Self-Contained
118 Application Bundlers for information on the arguments for each
119 bundler.
120
121 -callbacks
122 Specifies user callback methods in generated HTML. The format is
123 the following:
124
125 "name1:value1,name2:value2,..."
126
127
128 -description description
129 Description of the application.
130
131 -embedCertificates
132 If present, the certificates will be embedded in the JNLP file.
133
134 -embedjnlp
135 If present, the JNLP file will be embedded in the HTML document.
136
137 -height height
138 Height of the application.
139
140 -htmlparamfile file
141 Properties file with parameters for the resulting application when
142 it is run in the browser.
143
144 -isExtension
145 If present, the srcfiles are treated as extensions.
146
147 -name name
148 Name of the application.
149
150 -native type
151 Generate self-contained application bundles (if possible). Use the
152 -B option to provide arguments to the bundlers being used. If type
153 is specified, then only a bundle of this type is created. If no
154 type is specified, all is used.
155
156 The following values are valid for type:
157
158 · all: Runs all of the installers for the platform on which it is
159 running, and creates a disk image for the application. This
160 value is used if type is not specified.
161
162 · installer: Runs all of the installers for the platform on which
163 it is running.
164
165 · image: Creates a disk image for the application. On OS X, the
166 image is the .app file. On Linux, the image is the directory
167 that gets installed.
168
169 · dmg: Generates a DMG file for OS X.
170
171 · pkg: Generates a .pkg package for OS X.
172
173 · mac.appStore: Generates a package for the Mac App Store.
174
175 · rpm: Generates an RPM package for Linux.
176
177 · deb: Generates a Debian package for Linux.
178
179 -nosign
180 If present, the bundle generated for self-contained applications is
181 not signed by the bundler. The default for bundlers that support
182 signing is to sign the bundle if signing keys are properly
183 configured. This attribute is ignored by bundlers that do not
184 support signing. At the time of the 8u40 release of the JDK, only
185 OS X bundlers support signing.
186
187 -outdir dir
188 Name of the directory that will receive generated output files.
189
190 -outfile filename
191 Name (without the extension) of the file that will be generated.
192
193 -paramfile file
194 Properties file with default named application parameters.
195
196 -preloader preloader-class
197 Qualified name of the JavaFX preloader class to be executed. Use
198 this option only for JavaFX applications. Do not use for Java
199 applications, including headless applications.
200
201 -srcdir dir
202 Base directory of the files to package.
203
204 -srcfiles files
205 List of files in the directory specified by the -srcdir option. If
206 omitted, all files in the directory (which is a mandatory argument
207 in this case) will be used. Files in the list must be separated by
208 spaces.
209
210 -templateId
211 Application ID of the application for template processing.
212
213 -templateInFilename
214 Name of the HTML template file. Placeholders are in the following
215 form:
216
217 #XXXX.YYYY(APPID)#
218
219 Where APPID is the identifier of an application and XXX is one of
220 following:
221
222 · DT.SCRIPT.URL
223
224 Location of dtjava.js in the Deployment Toolkit. By default,
225 the location is
226
227 http://java.com/js/dtjava.js
228
229 · DT.SCRIPT.CODE
230
231 Script element to include dtjava.js of the Deployment Toolkit.
232
233 · DT.EMBED.CODE.DYNAMIC
234
235 Code to embed the application into a given placeholder. It is
236 expected that the code will be wrapped in the function()
237 method.
238
239 · DT.EMBED.CODE.ONLOAD
240
241 All the code needed to embed the application into a web page
242 using the onload hook (except inclusion of dtjava.js).
243
244 · DT.LAUNCH.CODE
245
246 Code needed to launch the application. It is expected that the
247 code will be wrapped in the function() method.
248
249 -templateOutFilename
250 Name of the HTML file that will be generated from the template.
251
252 -title title
253 Title of the application.
254
255 -vendor vendor
256 Vendor of the application.
257
258 -width width
259 Width of the application.
260
261 -updatemode update-mode
262 Sets the update mode for the JNLP file.
263
265 -appclass app-class
266 Qualified name of the application class to be executed.
267
268 -classpath files
269 List of dependent JAR file names.
270
271 -height height
272 Height of the application.
273
274 -name name
275 Name of the application.
276
277 -preloader preloader-class
278 Qualified name of the JavaFX preloader class to be executed. Use
279 this option only for JavaFX applications. Do not use for Java
280 applications, including headless applications.
281
282 -width width
283 Width of the application.
284
286 -alias
287 Alias for the key.
288
289 -keyPass
290 Password for recovering the key.
291
292 -keyStore file
293 Keystore file name.
294
295 -outdir dir
296 Name of the directory that will receive generated output files.
297
298 -srcdir dir
299 Base directory of the files to be signed.
300
301 -srcfiles files
302 List of files in the directory specified by the -srcdir option. If
303 omitted, all files in the directory (which is a mandatory argument
304 in this case) will be used. Files in the list must be separated by
305 spaces.
306
307 -storePass
308 Password to check integrity of the keystore or unlock the keystore
309
310 -storeType
311 Keystore type. The default value is "jks".
312
314 The -B option for the -deploy command is used to specify arguments for
315 the bundler that is used to create self-contained applications. Each
316 type of bundler has its own set of arguments.
317
318 General Bundler Arguments
319 appVersion=version
320 Version of the application package. Some bundlers restrict the
321 format of the version string.
322
323 classPath=path
324 Class path relative to the assembled application directory. The
325 path is typically extracted from the JAR file manifest, and does
326 not need to be set if you are using the other javapackager
327 commands.
328
329 icon=path
330 Location of the default icon to be used for launchers and other
331 assists. For OS X, the format must be .icns. For Linux, the format
332 must be .png.
333
334 identifier=value
335 Default value that is used for other platform-specific values such
336 as mac.CFBundleIdentifier. Reverse DNS order is recommended, for
337 example, com.example.application.my-application.
338
339 jvmOptions=option
340 Option to be passed to the JVM when the application is run. Any
341 option that is valid for the java command can be used. To pass more
342 than one option, use multiple instances of the -B option, as shown
343 in the following example:
344
345 -BjvmOptions=-Xmx128m -BjvmOptions=-Xms128m
346
347
348 jvmProperties=property=value
349 Java System Property to be passed to the VM when the application is
350 run. Any property that is valid for the -D option of the java
351 command can be used. Specify both the property name and the value
352 for the property. To pass more than one property, use multiple
353 instances of the -B option, as shown in the following example:
354
355 -BjvmProperties=apiUserName=example -BjvmProperties=apiKey=abcdef1234567890
356
357
358 mainJar=filename
359 Name of the JAR file that contains the main class for the
360 application. The file name is typically extracted from the JAR file
361 manifest, and does not need to be set if you are using the other
362 javapackager commands.
363
364 preferencesID=node
365 Preferences node to examine to check for JVM options that the user
366 can override. The node specified is passed to the application at
367 run time as the option -Dapp.preferences.id. This argument is used
368 with the userJVMOptions argument.
369
370 runtime=path
371 Location of the JRE or JDK to include in the package bundle.
372 Provide a file path to the root folder of the JDK or JRE. To use
373 the system default JRE, do not provide a path, as shown in the
374 following example:
375
376 -Bruntime=
377
378
379 userJvmOptions=option=value
380 JVM options that users can override. Any option that is valid for
381 the java command can be used. Specify both the option name and the
382 value for the option. To pass more than one option, use multiple
383 instances of the -B option, as shown in the following example:
384
385 -BuserJvmOptions=-Xmx=128m -BuserJvmOptions=-Xms=128m
386
387
388 OS X Application Bundler Arguments
389 mac.category=category
390 Category for the application. The category must be in the list of
391 categories found on the Apple Developer website.
392
393 mac.CFBundleIdentifier=value
394 Value stored in the info plist for CFBundleIdentifier. This value
395 must be globally unique and contain only letters, numbers, dots,
396 and dashes. Reverse DNS order is recommended, for example,
397 com.example.application.my-application.
398
399 mac.CFBundleName=name
400 Name of the application as it appears on the OS X Menu Bar. A name
401 of less than 16 characters is recommended. The default is the name
402 attribute.
403
404 mac.CFBundleVersion=value
405 Version number for the application, used internally. The value must
406 be at least one integer and no more than three integers separated
407 by periods (.) for example, 1.3 or 2.0.1. The value can be
408 different than the value for the appVersion argument. If the
409 appVersion argument is specified with a valid value and the
410 mac.CFBundleVersion argument is not specified, then the appVersion
411 value is used. If neither argument is specified, 100 is used as the
412 version number.
413
414 mac.signing-key-developer-id-app=key
415 Name of the signing key used for Devleloper ID or Gatekeeper
416 signing. If you imported a standard key from the Apple Developer
417 Website, then that key is used by default. If no key can be
418 identified, then the application is not signed.
419
420 mac.bundle-id-signing-prefix=prefix
421 Prefix that is applied to the signed binary when binaries that lack
422 plists or existing signatures are found inside the bundles.
423
424 OS X DMG (Disk Image) Bundler Arguments
425 The OS X DMG installer shows the license file specified by licenseFile,
426 if provided, before allowing the disk image to be mounted.
427
428 licenseFile=path
429 Location of the End User License Agreement (EULA) to be presented
430 or recorded by the bundler. The path is relative to the packaged
431 application resources, for example, -BlicenseFile=COPYING.
432
433 systemWide=boolean
434 Flag that indicates which drag-to-install target to use. Set to
435 true to show the Applications folder. Set to false to show the
436 Desktop folder. The default is true.
437
438 mac.CFBundleVersion=value
439 Version number for the application, used internally. The value must
440 be at least one integer and no more than three integers separated
441 by periods (.) for example, 1.3 or 2.0.1. The value can be
442 different than the value for the appVersion argument. If the
443 appVersion argument is specified with a valid value and the
444 mac.CFBundleVersion argument is not specified, then the appVersion
445 value is used. If neither argument is specified, 100 is used as the
446 version number.
447
448 mac.dmg.simple=boolean
449 Flag that indicates if DMG customization steps that depend on
450 executing AppleScript code are skipped. Set to true to skip the
451 steps. When set to true, the disk window does not have a background
452 image, and the icons are not moved into place. If the systemWide
453 argument is also set to true, then a symbolic link to the root
454 Applications folder is added to the DMG file. If the systemWide
455 argument is set to false, then only the application is added to the
456 DMG file, no link to the desktop is added.
457
458 OS X PKG Bundler Arguments
459 The OS X PKG installer presents a wizard and shows the license file
460 specified by licenseFile as one of the pages in the wizard. The user
461 must accept the terms before installing the application.
462
463 licenseFile=path
464 Location of the End User License Agreement (EULA) to be presented
465 or recorded by the bundler. The path is relative to the packaged
466 application resources, for example, -BlicenseFile=COPYING.
467
468 mac.signing-key-developer-id-installer=key
469 Name of the signing key used for Developer ID or Gatekeeper
470 signing. If you imported a standard key from the Apple Developer
471 Website, then that key is used by default. If no key can be
472 identified, then the application is not signed.
473
474 mac.CFBundleVersion=value
475 Version number for the application, used internally. The value must
476 be at least one integer and no more than three integers separated
477 by periods (.) for example, 1.3 or 2.0.1. The value can be
478 different than the value for the appVersion argument. If the
479 appVersion argument is specified with a valid value and the
480 mac.CFBundleVersion argument is not specified, then the appVersion
481 value is used. If neither argument is specified, 100 is used as the
482 version number.
483
484 Mac App Store Bundler Arguments
485 mac.app-store-entitlements=path
486 Location of the file that contains the entitlements that the
487 application operates under. The file must be in the format
488 specified by Apple. The path to the file can be specified in
489 absolute terms, or relative to the invocation of javapackager. If
490 no entitlements are specified, then the application operates in a
491 sandbox that is stricter than the typical applet sandbox, and
492 access to network sockets and all files is prevented.
493
494 mac.signing-key-app=key
495 Name of the application signing key for the Mac App Store. If you
496 imported a standard key from the Apple Developer Website, then that
497 key is used by default. If no key can be identified, then the
498 application is not signed.
499
500 mac.signing-key-pkg=key
501 Name of the installer signing key for the Mac App Store. If you
502 imported a standard key from the Apple Developer Website, then that
503 key is used by default. If no key can be identified, then the
504 application is not signed.
505
506 mac.CFBundleVersion=value
507 Version number for the application, used internally. The value must
508 be at least one integer and no more than three integers separated
509 by periods (.) for example, 1.3 or 2.0.1. The value can be
510 different than the value for the appVersion argument. If the
511 appVersion argument is specified with a valid value and the
512 mac.CFBundleVersion argument is not specified, then the appVersion
513 value is used. If neither argument is specified, 100 is used as the
514 version number. If this version is an upgrade for an existing
515 application, the value must be greater than previous version
516 number.
517
518 Linux Debian Bundler Arguments
519 The license file specified by licenseFile is not presented to the user
520 in all cases, but the file is included in the application metadata.
521
522 category=category
523 Category for the application. See
524 http://standards.freedesktop.org/menu-spec/latest/apa.html for
525 examples.
526
527 copyright=string
528 Copyright string for the application. This argument is used in the
529 Debian metadata.
530
531 email=address
532 Email address used in the Debian Maintainer field.
533
534 licenseFile=path
535 Location of the End User License Agreement (EULA) to be presented
536 or recorded by the bundler. The path is relative to the packaged
537 application resources, for example, -BlicenseFile=COPYING.
538
539 licenseType=type
540 Short name of the license type, such as -BlicenseType=Proprietary,
541 or "-BlicenseType=GPL v2 + Classpath Exception".
542
543 vendor=value
544 Corporation, organization, or individual providing the application.
545 This argument is used in the Debian Maintainer field.
546
547 Linux RPM Bundler Arguments
548 category=category
549 Category for the application. See
550 http://standards.freedesktop.org/menu-spec/latest/apa.html for
551 examples.
552
553 licenseFile=path
554 Location of the End User License Agreement (EULA) to be presented
555 or recorded by the bundler. The path is relative to the packaged
556 application resources, for example, -BlicenseFile=COPYING.
557
558 licenseType=type
559 Short name of the license type, such as -BlicenseType=Proprietary,
560 or "-BlicenseType=GPL v2 + Classpath Exception".
561
562 vendor=value
563 Corporation, organization, or individual providing the application.
564
566 The following options are no longer used by the packaging tool and are
567 ignored if present.
568
569 -runtimeversion version
570 Version of the required JavaFX Runtime. Deprecated.
571
572 -noembedlauncher
573 If present, the packager will not add the JavaFX launcher classes
574 to the JAR file. Deprecated.
575
577 · A -v option can be used with any task command to enable verbose
578 output.
579
580 · When the -srcdir option is allowed in a command, it can be used
581 more than once. If the -srcfiles option is specified, the files
582 named in the argument will be looked for in the location specified
583 in the preceding srcdir option. If there is no -srcdir preceding
584 -srcfiles, the directory from which the javapackager command is
585 executed is used.
586
588 Example 1 Using the -createjar Command
589
590 javapackager -createjar -appclass package.ClassName
591 -srcdir classes -outdir out -outfile outjar -v
592
593 Packages the contents of the classes directory to outjar.jar, sets
594 the application class to package.ClassName.
595
596 Example 2 Using the -deploy Command
597
598 javapackager -deploy -outdir outdir -outfile outfile -width 34 -height 43
599 -name AppName -appclass package.ClassName -v -srcdir compiled
600
601 Generates outfile.jnlp and the corresponding outfile.html files in
602 outdir for application AppName, which is started by
603 package.ClassName and has dimensions of 34 by 43 pixels.
604
605 Example 3 Using the -makeall Command
606
607 javapackager -makeall -appclass brickbreaker.Main -name BrickBreaker -width 600
608 -height 600
609
610 Does all the packaging work including compilation, createjar, and
611 deploy.
612
613 Example 4 Using the -signjar Command
614
615 javapackager -signJar --outdir dist -keyStore sampleKeystore.jks -storePass ****
616 -alias duke -keypass **** -srcdir dist
617
618 Signs all of the JAR files in the dist directory, attaches a
619 certificate with the specified alias, keyStore and storePass, and
620 puts the signed JAR files back into the dist directory.
621
622 Example 5 Using the -deploy Command with Bundler Arguments
623
624 javapackager -deploy -native deb -Bcategory=Education -BjvmOptions=-Xmx128m
625
626 -BjvmOptions=-Xms128m -outdir packages -outfile BrickBreaker -srcdir dist
627 -srcfiles BrickBreaker.jar -appclass brickbreaker.Main -name BrickBreaker
628 -title "BrickBreaker demo"
629
630 Generates the native Linux Debian package for running the
631 BrickBreaker application as a self- contained application.
632
633
634
635JDK 8 03 March 2015 javapackager(1)