Is there a reliable way of detecting what version of Java is installed on the client's machine using JavaScript?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Is there a limit to how many levels you can nest i
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- How to toggle on Order in ReactJS
According to the fact that we're finding this page with google, just to help the next guys finding this.
Is Java installed?
http://www.w3schools.com/jsref/met_nav_javaenabled.asp
Which version of Java is installed?
http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit
It's the best way I found to find the version of Java with JavaScript, but use it carefully because its version detection is really os/browser dependent, and on old browser version or on recent browser with old Java installed, it'll not work as expected. Take the time to do real tests before to use it in production.
Version of Java:
Is Java and is Java enable:
These functions works on Opera, Firefox, Chrome. I havn't IE.
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.
The detection logic does not work in IE32 on Windows7-64. It could not detect the java version it installed earlier.
Well, after further reading, the Java Deployment Toolkit on Windows uses ActiveX classid which may pose your app to hackers (see http://www.kb.cert.org/vuls/id/886582). I am out.
You can use the PluginDetect library from here: http://www.pinlady.net/PluginDetect/
I find that the JavaScript solution provided by the Java Deployment Toolkit gives an error... "deployJava.do_initialize is not a function".
One solution that I have used extensively for many years that does work in all browsers is the Java Version Display Applet. Unfortunately the original author's site seems to have disappeared, but you can download a copy of the Java Version Display Applet here.