A JNLP Tutorial: Part 1—An Introduction to JNLP
- A Web-Centered Protocol
- What Is JNLP All About?
- An Example
- To Be Continued...
This article and the second one in this series ("A JNLP Tutorial: Part 2An Example") cover the essentials of the Java Network Launching Protocol (JNLP). They are intended for a wide audience, mainly developers, and especially those new to this technology. At the end of this tutorial, you will have a clearer idea of this Java technology, and hopefully you will be able to use it directly in your applications.
A Web-Centered Protocol
Our story begins at the end. After your application is finished, you are ready to install it onto your client machines. This phase is called the software deployment phase. You should install the proper JRE and copy your JAR files on the client computers. Now, imagine that you publish all the JAR files on your Web site. Then, when everything is ready, you send an email to your customersasking them to point their Web browsers to a given URL. They do so, and after all needed installations take place automatically (the wanted JRE and your JAR files, plus all the other resources you need for your Java application to run), your clients can happily run your program. Then, whenever you update the JAR files on your Web server (say for the 1.2 release), they are automatically installed on client machines the next time your software is launched. So users always have the latest version of your applicationtransparently to them.
Everything works through the Web browser and the MIME type mechanism. The very first time users click on your application URL the browser will ask if that associated plug-in is to be installed. That plug-in is a JRE, with a little native executable (the JNLP Client) that will manage the whole protocol on your client's machines. Sun provides this executable freely for the most popular platforms (it is called Java Web Start) but other vendors and open source initiatives provide similar software for all the major OS. Starting from the Java 2 version 1.4 on, it comes included with the standard JRE package.