Thursday Oct 29, 2015

JavaOne 2015: Packaging Java Applications [CON3467]

On Thursday, October 29, Chris Bensen (Principal Member of Technical Staff, Oracle) presents Packaging Java Applications. This session shows how to bundle your application JAR files into operating system-specific installable applications that include the required Java Runtime Environment (JRE).

For more information about packaging your applications, see the following:

Thursday Oct 02, 2014

JavaOne 2014: Packaging and Deploying Java Apps in Java 8u20

Today at JavaOne, Danno Ferrin of Oracle presents the session Packaging and Deploying Java Apps in Java 8u20. This session provides information about the new features for the Java Packager and shows you how to integrate them into your build chain.

For more information on this topic, see The Java Packager Tool and Packaging Basics in the Java Platform, Standard Edition Deployment Guide.

Monday Sep 29, 2014

JavaOne 2014: Security with Java Deployment

Monday at JavaOne, David DeHaven and Chris Bensen of Oracle gave a presentation on Security with Java Deployment, which covers the changes that were made in the deployment security model over the past few years. Best practices were also discussed.

For additional information about the topics covered, see the following Java documentation:

Thursday Oct 03, 2013

Signing a JNLP File

There are several advantages to signing a JNLP file. It will:

  • Ensure that others cannot change the content in your JNLP file. For example, by adding a random library, or changing application information.
  • Allow the use of arbitrary Java Virtual Machine (JVM) options and Java system properties in your application.
  • Prevent others from referencing your JAR file directly in their HTML browser applets.

To create a signed JNLP file you don't sign the JNLP file itself, but you include the JNLP file inside the directory structure before the JAR file is created and then signed. The JNLP file must be named APPLICATION.JNLP and is included in the JNLP-INF subdirectory. The JAR file is then created and signed in the usual manner. When a web start application is started, the JNLP file used must be identical to the JNLP file in the signed JAR in order for the application to run.

Note that you cannot use the APPLET tag to run an applet if JAR file contains a signed JNLP file.

The Signing and Verifying JAR Files lesson in the Java Tutorial explains how to sign a JAR file.

Monday Sep 23, 2013

JavaOne 2013: Deploying Java Applications Securely

Monday at JavaOne, Andy Herrick, Mark Howe, and David DeHaven talked about best practices for making Java applets and Java Web Start applications more secure in the Deploying Java Applications Securely conference. Andy, David, and Thomas Ng will also be hosting a BOF session on Tuesday, Java Deployment Security, Features, and Best Practices.

For additional information on secure deployments, see Guidelines for Securing Rich Internet Applications in the Java Tutorials. The Deploying an Applet and Deploying a Java Web Start Application lessons summarize the deployment steps, including security recommendations such as using manifest attributes and signing the JAR file.

The Deployment Rule Set feature for enterprise environments is described in Deployment Rule Set in the Java RIA Development and Deployment guide. This guide also provides a flow chart of how deployment works in Rich Internet Application Deployment Process.

Friday Aug 05, 2011

JavaFX 2.0 Beta Packager Tool Now Available

The latest JavaFX 2.0 Beta Build 38 release contains an interim version of the JavaFX Packager tool, an executable file in the \bin directory of the JavaFX SDK. This blog gives you some preliminary information about this tool. For other information about JavaFX deployment, see Deploying JavaFX Applications.

The tool can be invoked in either of two ways:

  • From the command line
    Set the Windows PATH environment variable to the \bin directory of your JavaFX SDK installation, then at the command line enter javafxpackagers with no options, which displays the help.

  • Using Ant tasks
    You can use the options from the javafxpackager command in your Ant tasks. See the example in Using the JavaFX Packager Tool with Ant Tasks.

The JavaFX Packager tool performs any of the following tasks from the command line or in Ant scripts:

Table 1 Types of Commands in javafxpackager Command and Ant Tasks

Task and Description Description javafxpackager Command
Ant Task/Class

Make All

  • Compiles source files
  • Runs the Create JAR task.
  • Runs the Deploy task


(Not Available)

Create a JAR Archive

  • Creates a JAR archive from compiled source files
  • Creates binary files from any CSS files


FXJar task, FXJar class

Deploy (Generate Files for Web Deployment)

  • Generates JNLP and HTML files for web deployment


DeployFXTask class

Convert CSS Files to Binary Format

  • Only converts CSS files to binary format


CSSToBinTask class

Sign JAR Files

  • Digitally signs JAR files with a certificate

(Not available in this release)

FXSignJarTask class

JavaFX Packager Commands

The following sections contain a description of the commands listed in Table 1.

Make All

The command-line version of the JavaFX Packager tool has a -makeall command, which is a convenience command to produce deployment files with minimal configuration. The -makeall command performs the following tasks:

  • Compiles the source files

  • Runs the -createjar command, which includes converting the CSS files to their binary form.

  • Runs the -deploy command, which generates the JNLP and HTML files.

  • Converts the CSS files to their binary form.

The -makeall command presumes all the application sources are located in the src directory and places the result files in the dist directory. You can set a limited number of other options, described in the command line help.

Prior to calling the packaging (Create Jar) and deployment tasks, the -makeall command compiles the source files as well. For compilation, it searches for a JDK installation in directories specified by the JAVA_HOME or java.home system variables and for a JavaFX SDK installation in directories specified by the JAVAFX_HOME or javafx.home system variables.

Create a JAR Archive

The Create JAR command in the JavaFX Packager tool packages files into an executable JAR file that contains the application. Other options you can set are described in the command line help.

By default, the Create JAR command also includes the JavaFX Launcher in the JAR archive. The JavaFX Launcher is responsible for locating the installed JavaFX Runtime and invoking the main application class using this Runtime. Use the -noembedlauncher option to keep the launcher from being embedded.

Deploy (Generate Files for Web Deployment)

The Deploy command generates HTML and JNLP files for web deployment scenarios. You can set the options described in the command line help. For more information about web deployment files, see Deploying JavaFX Application Files in the Deploying JavaFX Applications.

Convert CSS Files to Binary Format

Converting CSS files to binary form is by default included in the -createjar command functionality, but the -createbss command can be invoked independently if you only want to convert CSS files to binary form. You can specify the input and output files as options. See the command line help for the list of options.

Sign JAR Files

This command, currently available only through an Ant task, signs a JAR file with a certificate you provide. There are options to specify the keystore file, key alias in the keystore, keystore password, key password, and type of keystore. See the <fxsignjar> element in the example Ant script below.

About Source Files

The type of source files required for each command is shown in the following table.

Table 2 Source File Types According to Command or Task Type

Command Type Source File Types

Make All (command line only)

JavaFX code files and other application resources

Create Jar

Classes and other application resources


JAR files and resources

Create BSS

CSS files

For Ant tasks, the source files for all commands are specified by the standard Ant fileset element, and for the command line interface the source files are specified by a combination of the -srcdir and -srcfiles parameters.

The -srcfiles option works in a similar manner as the Ant include option of the fileset element, in that if it is not present, all files in the preceding -srcdir are included, and if it is present, only files listed are included. For example, the following option includes both the temp\out.jar file and the content of the temp\dir2 and tmp directories:

-srcdir temp -srcfiles out.jar;dir2 -srcdir tmp

The command line version does not support advanced features of Ant, such as the **/*.html notation.

Using the JavaFX Packager Tool with Ant Tasks

Ant tasks can be configured in the same way as the javafxpackager command line options. The following example shows how the tasks and command line options are used in elements and attributes. Stay tuned for more documentation, coming soon.

Example 3-1 Ant Task Example Using JavaFX Packager Tool Options

<project name="HelloWorld" default="do-deploy" basedir=".">
    <target name="app-config">
        <property name="applet.width" value="600"/>

        <property name="applet.height" value="450"/>
    <target name="init-fx-tasks">
        <property name=""
        <taskdef name="fxdeploy"
        <taskdef name="fxjar"

        <taskdef name="fxsignjar"
    <target name="do-deploy" depends="app-config, init-fx-tasks">
        <delete file="jar/HelloWorld.jar"/>
        <fxjar destfile="jar/HelloWorld.jar"
               applicationClass="helloworld.HelloRectangle" >
            <fileset dir="classes"/>

              <attribute name="Implementation-Vendor" value="FX Team"/>
              <attribute name="Implementation-Title" value="HelloWorld"/>
              <attribute name="Implementation-Version" value="1.0"/>

        <fxdeploy width="${applet.width}" height="${applet.height}"
                  outdir="deploy" embedJNLP="true"
            <info title="HelloWorld"
                  vendor="FX Team"/>
            <application name="HelloWorld"
            <resources type="eager">
               <fileset dir="jar">
                  <include name="HelloWorld.jar"/>

        <genkey alias="TestAlias" storepass="xyz123" 
            dname="CN=Deploy, OU=JavaFX Dev, O=Oracle, C=US"/>
        <fxsignjar keystore="sign/test.keystore" alias="TestAlias" 
            storepass="xyz123" destDir="sign">
           <fileset file="jar/HelloWorld.jar"/>


Thursday Feb 18, 2010

Getting Java Applets to Work on Mac OS

Are you having trouble viewing some Java applets on a Mac? Got next generation Java Plug-in?[Read More]

Wednesday Nov 25, 2009

Java Applets Quiz

Do you enjoy quizzes? Take a minute to answer this quiz about Java applets.[Read More]

Tuesday Nov 24, 2009

Getting Applets To Talk To Each Other

Do you have more than one applet on a web page? Do you want the applets to share water cooler gossip? Ahem..ahem.. On a more serious note, do you want one applet to invoke methods or set variables of another applet? [Read More]

Tuesday Sep 22, 2009

Java Tutorial Update

We have just pushed an updated version of the Java Tutorial to the web. This update features:

Please let us know what you think!

- Sharon Zakhour

Thursday Apr 02, 2009

Deployment Toolkit 101

The Deployment Toolkit is a set of JavaScript functions that can help developers easily deploy rich internet applications. [Read More]

Tuesday Mar 31, 2009

Deploying An Applet In Under 10 Minutes

Want to learn how to quickly deploy a Java applet?[Read More]

Blog about Java technology documentation and news about Java releases.


« July 2016