Tuesday, 14 August 2012

Where is the jnlp library??

For those who are doing Java programming with Java Web Start or, like me, following through Deitel's Java How to Program chapter 24, you might be wondering where you can find the JNLP library. I did a bit of research and I finally found that the jnlp library located inside javaws.jar.

I am currently using JDK7 on Ubuntu 12.04 and the javaws.jar is located in /usr/lib/jvm/java-7-oracle/jre/lib. Basically it is located in jre/lib folder if you are using other operating systems and have installed JDK with different names.

Having located the exact place of the jar files, I added it as part of the libraries path to my Netbeans 7.1.2 by clicking on the Netbeans menu bar:

Tools > Libraries > New Library...

I put it under the name of JavaWebStart with the Library Type as "Class".

After that, on the same Library Manager window, I look for the JavaWebStart library, click on it and on the right hand side of the window, under Classpath tab, I click "Add JAR/Folder..." A Browse JAR/Folder window opens up. I navigate to where the javaws.jar is located and click Add JAR/Folder.

Having done that, in order to be able to use it in my project, I need to set up the project's library by right-clicking the project's name and click Properties. A Project Properties window opens up. Under Categories, on the left hand side of the window, click Libraries. Then on the right hand side of the window, you will see the Compile tab. All you need to do is click the "Add Library..." button and choose the library we have just added. Click OK to close the window.

That's it!

Well, if you just want to use the library in the project, I suppose you can skip the first part of Adding a new Libarary and just go to the project's properties and choose "Add JAR/Folder" button.

Hope this helps. : )


No comments:

Post a Comment