javafxpacakger
javafxpacakger is a very good utility provided by javafx team. This was missing in java. We need to use javac , jar , keytool, jarsigner etc for packaging in java. Where as it is very simple in JavaFX - just by pointing the source (-src) directory and Main class name (-appClass ) we can generate .jar , .html and .jnlp file.
Here is some more information on javafxpacakger.
Simplest form of javafxpackager
javafxpacakger -src <sourcedir> -appClass <main class name>
More options.
-res represent the resource directory if you have images from different directory.
Example: mySrc/com/xyz/a.fx myResource/com/xyz/play.png .
javafxpackager -src mySrc -res myResource -appClass com.xyz.a
-d <your own distribution directory> using this you can override the default "dist" directory. By default jar, jnlp, html will be placed in "dist" directory.
Example:
javafxpackager -src mySrc -res myResource -dist myDist -appClass com.xyz.a
Here is the options for changing the codebase, applet widht , height etc.
javafxpackager -src <src> -appVendor <vendor> -appVersion <appVersion> -appWidth <application width> -appHeight <application height> -appCodebase <codebase> -appClass <Main class>
How to use your own key store.
You can use your own keystore using -keystore option.
Here is how you will create keystore -
$JAVA_HOME/bin/keytool -genkey -dname "cn=FX packager,ou=CSG,o=SMI,c=US" -alias FxKey -keypass abc123 -keystore FxKeyStore -storepass xyz789 -validity 365
Now you can pass this information to javafxpackager
"$JAVAFX_HOME/bin/javafxpackager" -src src -res resource -appClass Sample -keyStore FxKeystore -keystorepassword xyz789 -keyalias FxKey -keyaliaspassword abc123 -sign
pack option and draggable.
You can use pack options to save download time. if draggable is used applet can be dragged out of browser provided you are using 6u10+
javafxpackager -src src -res resource -draggable -sign -pack200 -appClass <Main class>