views:

230

answers:

1

Question
Is it possible to get the version of the Java Plugin being used by the web browser, either through Javascript, or within a Java applet being run by the plugin?

Background
I'd like to run a Java applet embedded within the browser if the user is using Java Plugin2, or run it as a JWS application otherwise, because I need to control the max heap size of the applet/application, which is only possible in Plugin2.

I'm familiar with the Java Deployment Toolkit (DeployJava.js) and PluginDetect.js (http://www.pinlady.net/PluginDetect/), but these packages don't actually allow you to get the actual plugin version (only JRE version), and only give the plugin name in some browsers.

It can't be assumed either that a user with >JRE 1.6 Update 10 is running plugin2, because Mac OS X 10.6 has JRE 1.6 installed, but the original plugin running. Additionally, you can't force the user to upgrade their JRE with DeployJava.js on Mac OS X.

+3  A: 

Here are some client-side examples of checking for plugin2: http://people.fh-landshut.de/~mbien/cafebabe.html (specifically, view the page source)

cagreen
Thank you for those examples! That is exactly what I needed. I hadn't realized that deployJava has an isPlugin2() method, since it didn't seem to be listed in the deployment docs.
Monarch
For more information: http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html
cdmckay