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/