Where can I find the jnlp api jar in jdk 7?

Reto Höhener picture Reto Höhener · Nov 25, 2012 · Viewed 11.3k times · Source

Possible Duplicate:
Can’t find jnlp.jar in JDK 1.7

For jdk 1.6, it can be found here (according to Where can i download JNLP.jar):

${java.home}/sample/jnlp/servlet/jnlp.jar

However, I don't see this directory in my jdk 7 home.

Where did it go?

Answer

Aksel Willgert picture Aksel Willgert · Nov 25, 2012

In java 7 javax.jnlp.* packages are part of the the jre and can be found in the javaws.jar on the following path

C:\Program Files\Java\jre7\lib\javaws.jar

If using maven:

<dependency>
    <groupId>javax.jnlp</groupId>
    <artifactId>jnlp-api</artifactId>
    <version>7.0</version>
    <scope>system</scope>
    <systemPath>${java.home}/lib/javaws.jar</systemPath>
</dependency>

If you are after jnlp-download-servlet and jnlp-servlet.jar

The samples earlier provided as part of the jdk has to be downloaded separetlely from oracle now: Scroll down to "demos and samples"

Someone has been nice and put a copy in maven repos (guess we cant be sure it is not lagging behind if oracle updates theirs..):

<dependency>
    <groupId>org.codehaus.mojo.webstart</groupId>
    <artifactId>webstart-jnlp-servlet</artifactId>
    <version>1.0-6.0.02_ea_b02.2</version>
</dependency>

Edit: As Zalumon states in his answer the javax.jnlp.* api can also be found in the samples-package. Downloading this and adding jnlp.jar to the classpath from there should be recomended as oposed to adding javaws.jar as i suggested above.