views:

1885

answers:

5

Is there a reliable way of detecting what version of Java is installed on the client's machine using JavaScript?

+7  A: 

Check out the code in the Java Deployment Toolkit.

Rich Apodaca
In case someone comes across this again, note the toolkit has a major flaw: it returns the highest version of Java that is installed on the machine, not the highest version that is actually runnable (in IE, at any rate). Specifically, if you have both a Sun JRE and MSJVM installed, the toolkit will report the Sun JRE version even if it's disabled and the browser will actually run MSJVM.Adam Bellaire's link below seems more reliable, albeit less "clean" because it requires running an actual applet.
Dan
+2  A: 

Googling for

detect "java version" using javascript

yields a couple of results, this one looks like it might be useful. In essence, it tries to load a Java applet and then JavaScript asks the applet.

Adam Bellaire
Ironically, this page is now the first search result on Google for `detect "java version" using javascript`
kingjeffrey
+1  A: 

You can use the PluginDetect library from here: http://www.pinlady.net/PluginDetect/

sjbotha
A: 

If you use Google Analytics, this post might be helpful (see the forum thread for more details).

Michael Myers
A: 

Check out the solution here. Works like a charm (atleast on the local machine.... yet to test it on different environments) http://www.spiration.co.uk/post/1186/Java%20detect%20brower,%20JVM%20vendor,%20Java%20version%20etc

Anonymous