View RSS Feed

My Java Tips

Creating the JNLP File (Java Web Start)

Rate this Entry
by , 11-28-2011 at 06:08 PM (1566 Views)
If you plan to run an application with Java Web Start, you have to create JNLP (Java Network Launching Protocol) file. In this post, I will briefly explain how to do that.


The JNLP file is an XML file and it contains elements and attributes that tell Java Web Start how to run the application.

Presented below is a JNLP file for the Notepad application:

<!--?xml version="1.0" encoding="utf-8"?-->
Java Code:
<jnlp spec="1.0">codebase="URL of application on your Web server"
href="Notepad.jnlp"&gt;
<information>

<vendor>Sun Microsystems, Inc.</vendor>
<offline-allowed>
</offline-allowed></information>
<resources>
<jar>
<j2se version="1.3+">
</j2se></jar></resources>
<application-desc main-class="Notepad">
</application-desc></jnlp>
Once the file is ready, you have to place the application on the web server. Place all the JAR files and the
JNLP file on the web server. Make sure that the locations specified by the href attribute of the jar element in the JNLP file.

Submit "Creating the JNLP File (Java Web Start)" to Facebook Submit "Creating the JNLP File (Java Web Start)" to Digg Submit "Creating the JNLP File (Java Web Start)" to del.icio.us Submit "Creating the JNLP File (Java Web Start)" to StumbleUpon Submit "Creating the JNLP File (Java Web Start)" to Google

Tags: jnlp file, xml Add / Edit Tags
Categories
Java Web Start

Comments