File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Applet tag in Firefox - Finding the preferred JRE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet tag in Firefox - Finding the preferred JRE" Watch "Applet tag in Firefox - Finding the preferred JRE" New topic
Author

Applet tag in Firefox - Finding the preferred JRE

Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 93
Hello all... My applet is embedded using the Object tag, in which the 'classid' attribute allows the applet to choose a preferred JRE version to run.

Now, I need to make the applet compatible with Firefox. For this, I am trying to do away with 'Object' tag and use the 'Applet' tag. So far, so good and the applet loads with Firefox. The only hitch is, I dont find any equivalent for classid attribute and I am about to sacrifice JRE choosing feature. Can someone give me ideas on how I can accomplish this with the 'Applet' tag.. Thanks in advance.

Here is my code that works with IE and Firefox,



SCJP 5.0
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
What is the purpose of a "JRE choosing feature"? The browser will use the JVM that the user selected for running applets anyway; what else are you looking for?
Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 93
By JRE choosing I mean, if more than one version of JRE is installed, a particular version should be chosen and run. For instance, in my case, my machine has both 1.5 and 1.6 JREs installed, but my applet works best with JRE 1.5. Since an applet would choose the latest JRE out of all installed JREs, the classid tag jumps in and loads the applet using 1.5 JRE. The below link explains this,

http://download.oracle.com/javase/1.5.0/docs/guide/plugin/developer_guide/using_tags.html#object
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
I think the deployJava script allows you to do this: http://download.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html
Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 93
Many thanks.. That sounds like exactly what I was looking for. I am checking it out. I will let you know how it goes.
Sugantha Jeevankumar
Ranch Hand

Joined: Jun 06, 2007
Posts: 93
I tried the following code,



It works fine with both IE and Firefox when only JRE 1.5.0_22 is installed. When I installed both JRE 1.5.0_22 and 1.6.0_20, I expected the 'version' argument to kick in and load the applet in JRE 1.5, instead I got the following message in my java console,

java.lang.ClassNotFoundException: ButtonMoveApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: ButtonMoveApplet.class


I tried clearing the local JVM cache and tried the same in different combinations of JRE 1.5 and 1.6, still the same problem. Does anybody know why.. Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet tag in Firefox - Finding the preferred JRE