Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 2 of 3
You can now use javafxpackager to create an HTML page and a deployment descriptor (JNLP) file to handle the scenarios of embedding the JavaFX application
into a web page or running it via Java Web Start. The command in Listing 2 assumes that you are using the same directory used
in Listing 1:
javafxpackager -deploy -outdir out -outfile JPadFX -width 400 -height
400 -srcdir out -srcfiles jpadfx.jar
-appclass JPadFX -name "JPad FX" -title "JPadFX Equivalent of
JPad" -vendor "Jeff Friesen" -v
The following options are specified:
javafxpackager to create the deployment HTML and JNLP files.
out as the directory in which to store the HTML and JNLP files.
JPadFX as the name of the HTML and JNLP files. This option must be present; otherwise, javafxpackager throws an exception.
400 for the width.
400 for the height.
out as the directory containing the JAR file.
jpadfx.jar as the JAR file.
JPadFX as the main application class to be executed.
JPad FX as the name of the application. This information appears as the heading on the HTML page. If the name has a space, enclose
the string in quotation marks.
JPadFX Equivalent of JPad as the application's title. This information is stored in the JNLP file.
Jeff Friesen as the application's vendor. This information is stored in the JNLP file.
At this point, your out directory should contain JPadFX.jnlp and JPadFX.html along with jpadfx.jar.
Because JPadFX accesses the local filesystem, you must sign jpadfx.jar; otherwise, an exception will be thrown when you try to perform a file-oriented task, when the application is embedded in
a web page or run from Java Web Start. Assuming that you haven't purchased a certificate, you also need to create a self-signed
certificate. Use the JDK's keytool program to perform both tasks, as follows:
keytool -genkey -keystore jpadfx.ks -alias jpadfx
keytool -selfcert -alias jpadfx -keystore jpadfx.ks
This command creates a new key in a new keystore named jpadfx.ks, which is created in the current directory. For convenience, I've specified jpadfx as the alias. You will be prompted for information regarding the new key, such as password, name, and so on. Simply follow
the prompts.
The second command creates a self-signed test certificate. You'll be prompted to enter a password and then the certificate will be created.
Unfortunately, it is problematic to use javafxpackager to sign the previously created jpadfx.jar file with the test certificate. For this reason, I use the jarsigner command directly, as demonstrated below:
More from JavaWorld