By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,842 Members | 2,440 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,842 IT Pros & Developers. It's quick & easy.

Q: How to detect which JAVA VM is installed?

P: n/a
Hello,

I'm looking for a javascript, that can detect which java VM is installed and
what the current version is.

Can any of you give me some details?

Best regards,
Jan
Denmark

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


Jan Vinten wrote:
I'm looking for a javascript, that can detect which java VM is installed and
what the current version is.


Using Liveconnect calls from JavaScript to Java you can read out Java
properties with Netscape 4, Netscape 7 and I think with Opera 7:

if (navigator.javaEnabled() && typeof java != 'undefined') {
alert(
'java.version: ' + java.lang.System.getProperty('java.version')
+ '\n'
+ 'java.vendor: ' + java.lang.System.getProperty('java.vendor'))
}

But that will start up the Java VM.

You could also look into navigator.plugins:

var pluginName = 'Java Plug-in';
for (var i = 0; i < navigator.plugins.length; i++) {
var plugin = navigator.plugins[i];
if (plugin.name == pluginName) {
alert(plugin.description);
break;
}
}

That shouldn't start up the Java VM but is obviously restricted to
browsers that use a plugin such as that from Sun to run Java applets and
that support the navigator.plugins array.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.