Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write JavaScript function to check JRE version

I am new to JavaScript. How to write JavaScript function which will return installed Java version in the computer.

Thanks
Sunil Kumar Sahoo

like image 727
Sunil Kumar Sahoo Avatar asked Dec 09 '09 11:12

Sunil Kumar Sahoo


3 Answers

use the JNLP, the Sun Unified Deployment Mechanism, the getJREs() function is your answer:

<script src="http://www.java.com/js/deployJava.js"></script>
<script>
     var versions = deployJava.getJREs();
     alert(versions);
</script>

NB

it works in a consistent fashion across various browsers
like image 179
dfa Avatar answered Nov 12 '22 07:11

dfa


var JavaVersion = PluginDetect.getVersion('Java', 'getJavaInfo.jar');
var Java0Status = PluginDetect.isMinVersion('Java', '0', 'getJavaInfo.jar');
alert('Java version is ' + JavaVersion + '\n' + 'Java status is ' + Java0Status);

This is the plugin detect generator page, also you can check here for detail about that.

like image 39
baybora.oren Avatar answered Nov 12 '22 09:11

baybora.oren


You can use the deployJava.getJREs() method in the Deployment System (returns a list of currently installed JREs).

like image 36
Daniel May Avatar answered Nov 12 '22 08:11

Daniel May