4

I have an .aspx page which consists of applet code. In order to run this, the browser must have an active Java plugin.

Is there any way to check whether a Java plugin is installed and enabled, using Javascript?

Andrzej Doyle
  • 102,507
  • 33
  • 189
  • 228
Randhi Rupesh
  • 14,650
  • 9
  • 27
  • 46

2 Answers2

5
window.navigator.javaEnabled()//true if java enabled 

window.navigator.plugins // will give u all the plugins installed in the browser
Sarath
  • 9,030
  • 11
  • 51
  • 84
3

I would suggest you to go for the method recommended by Oracle

<script src="http://www.java.com/js/deployJava.js"></script>
<script>
    if (deployJava.versionCheck('1.6+')) {            
        var url = "http://docs.oracle.com/javase/tutorialJWS/deployment/webstart/examples/Notepad.jnlp";

        <!-- you can also invoke deployJava.runApplet here -->
        deployJava.createWebStartLaunchButton(url, '1.6.0'); 
    } else {
        document.location.href="http://oracle.com";
    }
</script> 

This is taken from http://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/jreVersionCheck.html

You should also take a look at Java Deployment Toolkit http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit

AurA
  • 12,135
  • 7
  • 46
  • 63
  • 1
    I had deployjava script through which i can find weather the java plugin is installed or not but i want weather it is enabled or not – Randhi Rupesh Feb 14 '13 at 09:25