Re: Does launching an applet via JNLP work on Linux at all?
"Qu0ll" <Qu0llSixFour@gmail.com> wrote in message
news:7tOdnalh3INETBnWnZ2dnUVZ_hednZ2d@westnet.com.au...
My applet is launched using a JNLP file (by specifying the jnlp_href
parameter in deployJava.js) and this is working very nicely on most
browsers on Windows but when I tried it on Linux (Ubuntu 9.10 and Firefox
3.5.7) it doesn't launch with the error being that it was unable to find
the applet class (ClassNotFoundException).
So, does launching an applet (yes, applet) using JNLP work at all on
Linux? In all cases I am using Java 6 Update 18.
There is absolutely no point in us continuing development of this applet
if we are unable to launch it via JNLP on all platforms so the answer to
this question is critical.
OK, I have stripped out all the IP-sensitive material and produced a very
simple example for others to test.
First, the applet itself:
package test;
import java.applet.Applet;
public class MyApplet extends Applet {
public void init() {
System.out.println("It works!");
}
}
Next, the JNLP (in a file named "applet.jnlp"):
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="6.0+" codebase="." href="applet.jnlp">
<information>
<title>Test</title>
<vendor>Qu0ll</vendor>
</information>
<resources>
<java version="1.6+" href="http://java.sun.com/products/autodl/j2se"
max-heap-size="512m"/>
<jar href="applet.jar" main="true" download="eager"/>
<property name="jnlp.packEnabled" value="true"/>
</resources>
<applet-desc name="Test" main-class="test.MyApplet" width="640"
height="480"/>
</jnlp>
And finally the HTML (index.html):
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test Applet</title>
</head>
<body>
<script src="http://java.com/js/deployJava.js"></script>
<script>
var attributes = { code:'test.MyApplet'} ;
var parameters = {jnlp_href: 'applet.jnlp',
java_arguments:'-Xmx512m -Djnlp.packEnabled=true'} ;
deployJava.runApplet(attributes, parameters, '1.6');
</script>
</body>
</html>
Simply build the applet and place it in a jar named "applet.jar", put all 3
files (JAR, JNLP, HTML) in the same directory and open the index.html. It
should output "It works!" in the Java console and does so on Windows with
most browsers but I cannot get it to work on Linux.
Please let me know of your results. Hopefully someone can see why it is not
working on Linux.
--
And loving it,
-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]