Ankur Verma
Ankur Verma

Reputation: 79

Using JNLP File to launch an application

I have a jsp page as:

<html>
    <head>
        <title>Try in JNLP</title>

        <script src="http://www.java.com/js/deployJava.js"></script>

        <script>    
             var dir = location.href.substring(0, location.href.lastIndexOf('/')+1);
            var url = dir + "try.jnlp";
            deployJava.createWebStartLaunchButton(url, '1.6.0');
        </script>
        <noscript>JavaScript is required for this page.</noscript>

    </head>

    <body>
    </body>
</html>

and have a jnlp file as :

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/try/" href="try.jnlp">

    <information>
        <title>TRY JNLP</title>
        <vendor>TRY JNLP</vendor>
    </information>

    <resources>
        <!-- Application Resources -->

        <jar href="TryJNLP.jar" main="true" />
    </resources>

    <application-desc name="Try JNLP"  main-class="tryjnlp.TRYJNLPApp">
     </application-desc>

    <update check="background"/>

</jnlp>

All jars are in their respective directories but when I double click the jnlp file it shows me an error saying :

java.lang.NoClassDefFoundError: org/jdesktop/application/SingleFrameApplication

with the its full error stack.

where as if I simply runs my swing application(TryJNLP.jar) by double clicking, it runs perfectly.

Please help me.

Upvotes: 0

Views: 3462

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168845

Since this code seems to depend on JSR 296, it will be necessary to add the: ApplicationFramework-<version>.jar to the run-time class-path of the application (in the resources section of the JNLP).

Upvotes: 1

Related Questions