Java Reference
In-Depth Information
IAN'S BASIC STEPS: JAVA WEB START
To set up Java Web Start:
1. Package your application in one or more JAR files.
2. Optionally, provide icons to represent your application in JWS format.
3. Describe your application in a JNLP (Java Net Launch Protocol) description file.
4. If necessary, set your web server's MIME types list to return JNLP files as type applica-
tion/x-java-jnlp-file .
5. If necessary, modify your application to use ClassLoader 's getResource() method in-
stead of opening files.
6. If necessary, sign the application's JAR files.
7. Make links to your application's JNLP file and a download link for JWS itself.
8. Enjoy using your application locally with easy web downloading!
Let's go over these instructions in detail. The first step is to package your application in one
or more JAR files. The jar program was described earlier in this chapter. The main JAR file
should include the application classes and any resources such as properties files, images, and
the like.
You should also include on the website any JAR files containing extra APIs, such as
JavaMail, com.darwinsys.util , or any other APIs. You can even include native code files,
but they are platform-dependent.
Optionally, you can provide icons to represent your application in JWS format. The applica-
tion icons should be in GIF or JPEG format and should be 64x64 pixels.
The next step is to describe your application in a JNLP (Java Net Launch Protocol) descrip-
tion file. The JNLP file is an XML file; see the official documentation . The file I used for en-
abling JabaDex to run with JWS is a subset of the allowable XML elements but should be
moderately self-explanatory. See Example 21-3 .
Example 21-3. JabaDex.jnlp
<!-- JNLP File for JabaDex Application -->
<jnlp spec="1.0+"
Search WWH ::




Custom Search