Our Java client application is currently implemented to run as a Java Applet. This works fine when run on the Java plugin from IE or started with Oracle's Java Web Start but we are trying to add support for using OpenWebStart.
I understand that OpenWebStart does not support running Applets but from what I have read, it should be possible to use the same class in the same jar file both as an Applet and as an application with separate JNLP files. I have a simple HelloWorld class that extends Applet but also has a main method. The class is bundled into a jar file and configured as the Main-Class for the jar. I have an HTML file I can use to run the app via the <applet> tag and I have two HTML files with matching JNLP files (one with <applet-descr> and one with <application-descr>). I can run the app as an Applet with appletviewer (or from a web page) using the HTML file and I can run it as an application with "java -jar" so that much appears to be working. However, when I try to run the app with the JNLP files (either from the command line or from a web server) it always runs as an applet. This is OK when using Oracle's Java Web Start but the app crashes immediately after painting the app frame.
Here's the JNLP file for running as an Applet:
----
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://point:8080/hello" href="HelloWorldGuiApplet.jnlp">
<information>
<title>HelloWorldGuiApplet</title>
<offline-allowed/>
</information>
<resources>
<j2se version="1.8+"/>
<jar href="lib/HelloWorldGuiApplet.jar" main="true"/>
</resources>
<applet-desc name="HelloWorldGuiApplet" main-class="HelloWorldGuiApplet" width="1024" height="768">
<argument>Hello world!!!!</argument>
</applet-desc>
<security>
<all-permissions/>
</security>
</jnlp>
and here's the JNLP file for running as an application:
----
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://point:8080/hello" href="HelloWorldGuiApplet.jnlp">
<information>
<title>HelloWorldGuiApplet</title>
<offline-allowed/>
</information>
<resources>
<j2se version="1.8+"/>
<jar href="lib/HelloWorldGuiApplet.jar" main="true"/>
</resources>
<applet-desc name="HelloWorldGuiApplet" main-class="HelloWorldGuiApplet" width="1024" height="768">
<argument>Hello world!!!!</argument>
</applet-desc>
<security>
<all-permissions/>
</security>
</jnlp>
Any tips or pointers appreciated.