javafxpackager - JavaFX File Packager Utility


javafxpackager - Packages files comprising a JavaFX Script application for deployment.


javafxpackager [options] class [args...]


The javafxpackager tool creates an application in a format that is specific for a target profile, either desktop or mobile.


The javafxpackager utility supports the following command line options:

-encoding <encoding>

Optional. Specifies character encoding used by source files.

-paramFile <property file>

Optional. Specifies the named application parameters stored in an external property file.

-profile [ desktop | mobile ]

The -profile option specifies the javafx platform. JavaFX 1.1 SDK supports desktop and mobile, and defaults to desktop. Use the -profile mobile option setting to generate files needed by the JavaFX emulator tool. See the emulator man page for details.

Internally the -profile option specifies the configuration file that sets environment variables.

-src | -sourcepath <source root1> [;<source root2> ...]

Required. Specifies the root directory of the source tree holding the application to be packaged.

Here is an example of a source tree that illustrates these required option settings:


In the example below, the -src option specifies src as the root directory. The appClass option specifies the Main.fx file in the Package1 source file subdirectory.

javafxpackager -src src -appClass package1.Main

At least one source root is required.

-cp | -classpath | -librarypath <library1> [;<library2> ...]

Optional. Specifies the classpath.

-res | -resourcepath <resource root1> [;<resource root2> ...]

Optional. Specifies the resource path.

-d | -destination [target directory]

The default target directory is ./dist

-workDir <working directory>


-v | -verbose

Enables verbose output.

-appName <application name>

The default application name is the application class name.

-appVendor <application vendor>

The default application vendor is the user.name Java system property.

-appVersion <application version>

The default application version is 1.0.

-appClass <application class>

Specifies the class containing main for applets. This argument is mandatory.

-appWidth <applet width>

The default applet width is 200 pixels.

-appHeight <applet height>

The default applet height is 200 pixels.

-appCodebase <application code base URL>

The default code base is empty.


Builds a signed application. -sign is used while using -keystore, -keystorePassword, and so on. If -sign is not specified, a self-signture is not created.


Makes the application draggable from the web browser.

-keystore <keystore for signing>

A temporary self-signature is created when keystore is not specified.

-keystorePassword <password>

Mandatory when signing with specific keystore.

-keyalias <alias>

Mandatory when signing with specific keystore.

-keyaliasPassword <password>

keystore Password is used instead when not specified.


Compresses an application using pack200. This option creates a file called MyApplication.jar.pack.gz in the default ./dist directory.


Prints a help screen.


Prints the JavaFX Toolchain version number.


javafxpackager -src ./mysources -appClass mypackage.MyApplication

Builds all JavaFX and Java sources into ./dist/MyApplication.html, ./dist/MyApplication.jnlp, ./dist/MyApplication.jar, and ./dist/MyApplication_browser.jnlp

javafxpackager -src ./mysources -appClass mypackage.MyApplication -p mobile

Builds all JavaFX and Java sources according to mobile profile specification into ./dist/MyApplication.jad and ./dist/MyApplication.jar.

Copyright © 2009 Sun Microsystems, Inc. All rights reserved.

Sun is required to provide certain third party notices. Please see Third Party Notices for the text of such notices.

Spec-Zone.ru - all specs in one place