Introduction to Java Web Start

suggest change

The Oracle Java Tutorials summarize Web Start as follows:

Java Web Start software provides the power to launch full-featured applications with a single click. Users can download and launch applications, such as a complete spreadsheet program or an Internet chat client, without going through lengthy installation procedures.

Other advantages of Java Web Start are support for signed code and explicit declaration of platform dependencies, and support for code caching and deployment of application updates.

Java Web Start is also referred to as JavaWS and JAWS. The primary sources of information are:

Prerequisites

At a high level, Web Start works by distributing Java applications packed as JAR files from a remote webserver. The prerequisites are:

- From Java 5.0 onwards, Web Start support is included in the JRE / JDK.
- For earlier releases, Web Start support is installed separately.  
- The Web Start infrastructure includes some Javascript that can be included in a web page to assist the user to install the necessary software.
- they need a compatible web browser, and 
- for modern (secure) browsers, they need to be told how to tell the browser to allow Java to run ... without compromising web browser security.

An example JNLP file

The following example is intended to illustrate the basic functionality of JNLP.

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="https://www.example.com/demo" 
    href="demo_webstart.jnlp">
    <information>
        <title>Demo</title>
        <vendor>The Example.com Team</vendor>
    </information>
    <resources>
        <!-- Application Resources -->
        <j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="Demo.jar" main="true"/>
    </resources>
    <application-desc
         name="Demo Application"
         main-class="com.example.jwsdemo.Main"
         width="300"
         height="300">
     </application-desc>
     <update check="background"/>
</jnlp>

As you can see, a JNLP file XML-based, and the information is all contained in the <jnlp> element.

Setting up the web server

The webserver must be configured to use application/x-java-jnlp-file as the MIMEtype for .jnlp files.

The JNLP file and the application’s JAR files must be installed on the webserver so that they are available using the URLs indicated by the JNLP file.

Enabling launch via a web page

If the application is to be launched via a web link, the page that contains the link must be created on the webserver.

<a href="https://www.example.com/demo_webstart.jnlp">Launch the application</a>

NOTE: It is a bad idea to encourage users to encourage to install Java this way, or even to enable Java in their web browsers so that JNLP web page launch will work.

Launching Web Start applications from the command line

The instructions for launching an Web Start application from the command line are simple. Assuming that the user has a Java 5.0 JRE or JDK installed, the simply need to run this:

$ javaws <url>

where <url> is the URL for the JNLP file on the remote server.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents