Skip to main content

Switch to specified version's java browser plugin installed

3 replies [Last post]
hotjar
Offline
Joined: 2007-07-19

I write a java applet and want to confirm the compatibility on all major java platform(1.4,1.5,1.6). In order to do that, I must test 1.6 platform and remove my 1.6 jre, then the current jre which browsers are using become 1.5(For I installed 1.5 before, remove 1.6, 1.5 bowser plugin will take over automatically), I test 1.5, remove it, then 1.4. It will take a long time, JRE's installing and removing process usually takes me three minites or so, and that is a dull work though. Especially when I heard from someone that something went wrong on an explicit version, and I can not switch to this version at once. The worst situation is the version happened to be 1.4, so I must remove twice.

I did some homework before posting here. Something related in the page below:

http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/jc...

Under the subtitle "Java Applet Runtime Settings"
But that trick doesn't work on jre 1.6.

I want something like a tool that list all version's browser plugin installed in my system, offer developer a chance to switch to a specified one at once. That seems to be a functionality which JavaConsolePanel fails to offer.

Has anybody encountered that kind of problem before? Can you give me a hint to work through it? I even find and replace all strings like "C:\Program Files\Java\jre1.6.0_02\bin\npjpi160_02.dll" in my windowsXP's registry, and that does nothing good.

Any help will be appreciated.

David
2007-12-2

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hotjar
Offline
Joined: 2007-07-19

So many people have read this thread in the past two days, but nobody could figure out what's going on. So I just let it go.

Maybe that's a bug for jpi, so I wish this question could draw someone's attention who are working on it. Maybe this kind of jpi version switch operation can be done perfectly in the next version's jre. Maybe...

Thank you for everyone's valuable time.

David
2007-12-4

mhey123
Offline
Joined: 2003-07-01

Why don't you have multiple HTML pages and use the

or tag to embed the applet instead of using the tag. The object tag is for IE, and embed for firefox. Both of these tags allow you to specify what version of java to use when the applet is loaded. Each HTML page would have a specific version number of java to test with. You're probably interested in the 'exact' version number method (at the bottom of the snippet...) The following is a a snippet from http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/using_t... Using the embed tag You use the embed tag to deploy applets that are to be used only with the Mozilla family of browsers. Following is an example of the embed tag: The type attribute can have one of two forms: * type="application/x-java-applet;version=1.5.0" With this form, the highest installed JRE that supports the MIME type application/x-java-applet;version=1.5.0 is invoked to run the applet. If a JRE with a version number equal to or greater than the version number specified is installed locally, then that JRE is invoked. Otherwise the user is directed to the URL specified as the value of the pluginspage attribute. * type="application/x-java-applet;jpi-version=1.5.0_01 With this form, a JRE with the exact version given by the the value of jpi-version (in this example, 1.5.0_01) is invoked to run the applet. Otherwise the user is directed to the URL specified as the value of the pluginspage attribute.
hotjar
Offline
Joined: 2007-07-19

Thank you, mhey123. I've tried as documents described:

and

The first code segment works fine in my IE 7, but uses the wrong version 1.6.0_02. It just could not show anything in my firefox 2.0.0.11 for"Unknown Plugin" and "No suitable plugins were found."

The second code segment works fine in both IE 7 and firefox 2.0.0.11, but the jre which browser uses is my lastest jpi version 1.6.0_02

David
2007-12-3