Is there a way to detect if java is installed on your machine or if java is disabled on the browser. We use java applets in our application but before the applet is loaded we use "deployJava.js". Sadly even if Java is disabled on the browser it says java is not installed.
So is there way to differentiate if Java is installed or Java is disabled, preferably using javascript. I have also tried using "navigator.javaEnabled()" but it gives me the same result as using "deployJava.js".
-
I doubt it's possible.Denys Séguret– Denys Séguret2013年06月11日 14:57:06 +00:00Commented Jun 11, 2013 at 14:57
-
Just check for disabled .... anyways you cannot enable it if it is disabled via javascript.. hope this previous post help stackoverflow.com/questions/14871287/…AurA– AurA2013年06月11日 15:47:17 +00:00Commented Jun 11, 2013 at 15:47
3 Answers 3
You can't.
And that would be very annoying if you could. There's already enough information leaking from the browser to the page, if it started telling people what I have installed but that I have ostensibly disabled, that would be very annoying.
I guess it could be possible and useful to envision an API for that, but in the current state there isn't any: either the plugin is here to be used, or it isn't. It doesn't matter whether it's installed or not.
I guess you'll have to work around it by stating in your user-facing messages that Java either needs to be installed or enabled. Or you could offer to download a diagnostic tool to run it and check it locally, that could be another working alternative, though with the obviously annoying extra-steps to perform (and an additional tool for you to support).
Comments
- Add a redirect to the HTML page in question. Redirect to
javaNotEnabledOrNotInstalled.html(but think of a less descriptive and silly name for it). - Early in the applet
init(), call JS to cancel the redirect.
Note also that in the traditional applet element..
<applet
code=..
width=..
height=..
alt='Java is installed but disabled!'>
No Java Plug-In installed in this browser. Get Java free from..
</applet>
In this circumstance, if Java is not installed at all, the user should see..
No Java Plug-In installed in this browser. Get Java free from..
However if Java is installed but disabled, they should see..
Java is installed but disabled!
7 Comments
Here is something js window.navigator.plugin