OpenJDK, how To make an Applet run?

Hi. Does anyone have a clue why OpenJDK 6 / 7 (Ubuntu Linux here) cant open many Applets?
Is it the icedTea plugin not wanting to open applets?
Or do I have to sign an applet to run it or have to have a manifest included.

The classloader does not load my main class…

Small Example applet:
http://www.rtsmaker.com/bloomparticle.html

The standard Java from Oracle has no problems…


thisismyusername@ubuntu:~$ firefox
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.3) (6b24-1.11.3-1ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize applet. 
	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:735)
	at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:676)
	at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:886)
Caused by: java.lang.ClassNotFoundException: BloomParticles
	at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1401)
	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:725)
	... 2 more
Caused by: 
java.lang.ClassNotFoundException: BloomParticles
	at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1401)
	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:725)
	at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:676)
	at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:886)
java.lang.NullPointerException
	at net.sourceforge.jnlp.NetxPanel.runLoader(NetxPanel.java:154)
	at sun.applet.AppletPanel.run(AppletPanel.java:380)
	at java.lang.Thread.run(Thread.java:679)
java.lang.NullPointerException
	at sun.applet.AppletPanel.run(AppletPanel.java:430)
	at java.lang.Thread.run(Thread.java:679)


Runs fine over here on Win7 + Chrome :smiley:

I guess you have the normal Oracle Java installed?

My problem is to get it running a a standard boring Ubuntu installation, where only OpenJDK and IcedTea plugin are offered the the common user.

Hi

JNLP protocol is not yet supported in Icedtea plugin for applets.

This is off topic and a simple gratuitous provocation. OpenJDK, Icedtea and Icedtea-web (including NetX) are free open source softwares, everyone is invited to contribute.

OpenJDK 1.7 is the reference implementation of Java 1.7, the term “normal” is very subjective. You could have contacted Icedtea developers to get an answer about your problem. I know someone under Lubuntu (Ubuntu with LXDE); if you really need some help, she can give a try to your applets but only if you avoid bashing and not constructive remarks about OpenJDK and Icedtea. Even NetX is not installed by default, I will report that soon.

Edit.: Rather use Java Web Start until it is fixed but your end users will have to install Icedtea-netx packages if they are not already installed by default.

If you look at my example:

http://www.rtsmaker.com/bloomparticle.html
http://www.rtsmaker.com/bloomparticle.jar

The jar just consists of a single class file inside a jar. Nothing else in there. (no meta-inf directory, no signing information)
So I did not mix anything here.

For OpenJDK to run it, it MUST be signed?

There is a regression in Icedtea-web 1.2 (fixed in Icedtea-web 1.3): all JARs must be signed or (exclusive) unsigned, you cannot mix unsigned JARs with signed JARs. However, I think your problem is caused by the lack of support for the JNLP protocol in applets.

Edit.: one of your other applets works here in the past (Mageia Linux 2, OpenJDK 1.6, Icedtea-web 1.2), this one just freezes.

Griefer4k works :smiley:

I get this for the other:
[gouessej@localhost ~]$ appletviewer http://www.rtsmaker.com/bloomparticle.html
Charger : la classe W est introuvable.
java.lang.ClassNotFoundException: W
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:219)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:152)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:633)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:797)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:726)
at sun.applet.AppletPanel.run(AppletPanel.java:379)
at java.lang.Thread.run(Thread.java:722)

“la classe W est introuvable” means “the class W cannot be found”.

I see BloomParticle.class in your JAR, not W.

Right now Im running Mint with Oracle Java installed. I have to switch to the Ubuntu 12.04 installation to check.
But I remember none of the Java4K games to run in the default setup. (Which I presume to be on most casual Linux installations)

Yes, like the stacktrace I posted above.
It can not find the class.

Oracle Java can however.
I had this same problem already way back in Ubuntu 10.04

Ah, ok, Sorry, I will try it without the code=“W”

Please fix that. Then I can test it and confirm it works under Mageia Linux 2 (and it should work under Ubuntu too).

Changed the page, It should load in the appletviewer now.
I will see if it runs on the Ubuntu then

No, same Problem in Ubuntu.
The appletviewer loads it, but the IcedTea Plugin still throws:


java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.3) (6b24-1.11.3-1ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize applet. 
	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:735)
	at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:676)
	at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:886)
Caused by: java.lang.ClassNotFoundException: BloomParticles
	at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1401)
	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:725)
	... 2 more
Caused by: 
java.lang.ClassNotFoundException: BloomParticles
	at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1401)
	at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:725)
	at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:676)
	at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:886)
java.lang.NullPointerException
	at net.sourceforge.jnlp.NetxPanel.runLoader(NetxPanel.java:154)
	at sun.applet.AppletPanel.run(AppletPanel.java:380)
	at java.lang.Thread.run(Thread.java:679)
java.lang.NullPointerException
	at sun.applet.AppletPanel.run(AppletPanel.java:430)
	at java.lang.Thread.run(Thread.java:679)


I don’t see your changes even by pressing CTRL+R. I have just downloaded your files (html & JAR), removed code=“W” and launch the applet locally with the applet viewer. Now, I see pretty blue particles ;D

I’m sorry but when I use wget to get your HTML file, “code=“W”” is still here, that’s the only problem.

Ok, I must have submitted a wrong page ::),

Try http://rtsmaker.com/index.html

Griefer4k does load.
So good, I think I can find my error based on that.

Thanks

This is still wrong as you write both “code=“BloomParticles.class”” and “code=“BloomParticles””. Please only use “code=“BloomParticles.class”” and it will work.

Ok, I think I had a pile of things done wrong ::slight_smile:

http://rtsmaker.com/bloomparticles2.html works now

(I totally forgot to compile it for 1.6 … and had this double code parameter)

Well, now Im happy with OpenJDK Again

It works here too but your problem has nothing to do with OpenJDK and Icedtea. Maybe they are a bit stricter.