6

How to check whether Java plugins are installed or not in a browser using java or javascript or JSP Code .?

SSN
  • 169
  • 1
  • 5
  • 17

5 Answers5

7

Java/Sun/Oracle provides a deployment toolkit script in the form of a JavaScript file that lets you achieve what you need.

You could invoke the getJREs() function which returns an array of currently-installed JRE version strings.

You can even install a particular JRE version if you need to, via the installJRE(requestVersion) function.

Ryan Fernandes
  • 8,238
  • 7
  • 36
  • 53
3

Use deployJava.js to check the java installation.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<SCRIPT LANGUAGE="JavaScript" src="deployJava.js">
</SCRIPT>
<script type="text/javascript">
function call()
{
    if (deployJava.versionCheck("1.6.0+") || deployJava.versionCheck("1.4") || deployJava.versionCheck("1.5.0*")) 
    {
        alert("Java is Enabled");
    } else 
    {
        alert("Java is Not Enabled");
    }
}
</script>
<BODY onload="call();">
</BODY>
</HTML>
Dead Programmer
  • 12,427
  • 23
  • 80
  • 112
1

I tried jqplugin and deployJava first, but those did fail for IE8 at least. So i came over this lib, that has the most comprehensive documentation and implementation that i could find and worked for all the browser that i could test

http://www.pinlady.net/PluginDetect/Java/

Dominik Steiner
  • 141
  • 1
  • 4
1

From Navigator javaEnabled(): var x = "Java Enabled: " + navigator.javaEnabled();

The result of x will be: Java Enabled: false

Qantas 94 Heavy
  • 15,750
  • 31
  • 68
  • 83
1

Try this:

https://cdnjs.com/libraries/jqplugin

Eg.

jQuery.browser.java //Java
cagdasalagoz
  • 460
  • 1
  • 12
  • 22
ysrb
  • 6,693
  • 2
  • 29
  • 30
  • thanks.but do we have any code in java or Java script..? I dont want to use jQuery .? – SSN Apr 12 '11 at 07:07
  • JQuery is a javascript framework/library/helper. I really encourage you to use it. It really helps. You can configure it so that it will not conflict with other libraries. – ysrb Apr 12 '11 at 07:08
  • I tried that code but it returns "undefined" instead of true or false . Can u guide me on this please ..? – SSN Apr 12 '11 at 07:24
  • Can I see your HTML? Is it somewhere accessible? Do you have URL? – ysrb Apr 12 '11 at 08:04
  • Older jquery version have problems detecting java plugin .use the script given below. – Dead Programmer Apr 12 '11 at 08:07