For this little experiment, we need the following pieces:
•A JNLP file—an XML file that will contain all the details.
• One JAR file, containing a simple Java class. This will represent our application.
All of the following files are available on the companion Web site for this topic.
They are organized under the test directory. Copy it onto your local hard disk
under the c:/ path.
Listing 8.1 is on the Companion Web site for this topic.
L ISTING 8.1 The Test JNLP File
<?xml version=”1.0” encoding=”UTF-8”?>
<homepage href=”” />
<j2se version=”1.2+” />
<jar href=”bin/test.jar” />
This XML file instructs the JNLP Client on several things.
• Where the resources are located (on the local file system, see the protocol “ file:/// ”in
• Where to find the JNLP file itself, so that the application it represents can be cached in
the application manager, and so on.
• Some information about the application: its title, vendor, and the Web page in which you
can look for updates.
• The resources needed by the application. In this case, a single JAR file will suffice. Note
the <j2se> element, which informs the JNLP Client about the version of J2SE needed to
run that application. The string “ 1.2+ ” means J2SE version 1.2 or any higher.