JavaFAQ Home » Networking
More about JNLP - Java Network Launching Protocol...
The Java Network Launching Protocol is a new Java protocol to allow remote
applications to be downloaded and run on a client machine. All necessary class
files, images, etc, can be downloaded, and do not need to be present on the
client machine beforehand. This chapter looks at JNLP and compares it to Jini,
and shows how the two can be used together to get the advantages of both
The concept of applets was one of the initial boosts for Java's success.
However, while Java has gone from strength to strength, applets have fallen by
the wayside. This is partly because the sandbox model is so tight that there is
little you can do with them, but also because the Java runtime engines in the
different browsers were inconsistent and often buggy, frequently causing the
browser to crash.
THE JNLP is another approach to this type of problem, where remote code is sent
to a browser for execution. Instead of running within the browser though, the
code is run in a manner similar to CGI scripts by passing it to a Java runtime
engine that runs as a separate application. There are plenty of mechanisms
within JNLP to ensure safety in a variety of sandbox (or freer) models, and also
to ensure that resources required are present (such as a late enough version of
the Java runtime).
A JNLP application is described by a JNLP file, which is an XML do*****ent.
Typically, this do*****ent will be downloaded by a Web browser. The browser itself
will not know what to do with this file, so it will pass it to a "JNLP
helper" to deal with. This is a standard browser technique, and allows a
browser to call a Postscript viewer such as ghostscript to handle
Postscript files, Adobe acrobat to handle PDF files, and so on. The
JNLP helper will read the list of resources required and download them if
necessary. It will also check that all constraints such as version of the Java
runtime are satisfied. Once this is all done, the helper will start the Java
A minimal JNLP file can be
File Classifier Application
This states the codebase from where all resources will be drawn, the jar file
containing the classes and the main class of an application (rather than an
applet). This is enough for the helper to run the application.
3. Jini and JNLP Comparison
On the face of it, Jini and JNLP appear to occupy similar spaces in that they
both allow code to be migrated to a client machine and to execute there. The
following table summarises some of the differences and similarities
4. Combining Jini and JNLP
|downloads a service
||downloads an application
|a client must be running to request a service
||a browser must be running which calls a helper to start the
|each service looks after itself, independently of any clients
||each JNLP file specifies all required parts of an application; if any
part changes, the JNLP file must be updated
|the client may need to know the location of a lookup service, but not
of any service
||the user of a JNLP application must know the URL of the JNLP file
|no generic client
||generic JNLP helper
The whole book (Jan Newmarch's Guide to Jini Technologies) and chapter "Java
Network Launching Protocol" you can read here.
Printer Friendly Page
Send to a Friend
Search here again if you need more info!