Java Reference
In-Depth Information
Ant Tasks
There are two Ant tasks that assist in signing JARs. First, there is the genkey task
that generates the key. Second, there is the signjar task that facilitates signing
JAR files. The following is an example build.xml that uses these tasks to sign the
NasaImageBrowser JAR file.
<?xml version="1.0" encoding="UTF-8"?>
<project name="NasaImageBrowser" default="default"
basedir="." >
<target name="default" >
< genkey alias="myKey" storepass="password"
dname="CN=JFXBOOK"
keystore="./myKeystore" />
< signjar alias="myKey"
storepass="password"
keystore="./myKeystore"
jar="NasaImageBrowser.jar" />
</target>
</project>
To run a JavaFX applet, it is necessary to create a JNLP XML file that defines
the required resources, security settings, and applet configuration properties for
deployment. By default, the javafx() JavaScript function, defined in the next
section, defines this filename for this JNLP deployment file to be the concatena-
tion of the applet name with _browser.jnlp . For the NASA Image Browser
application, this is NasaImageBrowser_browser.jnlp . This can be changed to
point to another name by including a "jnlp_href" launch parameter in the Java-
Script function, javafx() . This is described in the next section, JavaFX Applet
Launch JavaScript.
There are four main sections to the JNLP XML, <information> , <security> ,
<resources> , and <applet-desc> . These are shown in Listing 9.1.
Listing 9.1
JNLP XML File
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+"
href="NasaImageBrowser_browser.jnlp">
<information>
<title>NasaImageBrowser</title>
<vendor>jfxbook</vendor>
<homepage href="http://www.jfxbook.com"/>
<description>NasaImageBrowser</description>
continues
Search WWH ::




Custom Search