Q: How to detect which JAVA VM is installed?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jan Vinten

    Q: How to detect which JAVA VM is installed?

    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



  • Martin Honnen

    #2
    Re: Q: How to detect which JAVA VM is installed?



    Jan Vinten wrote:
    [color=blue]
    > I'm looking for a javascript, that can detect which java VM is installed and
    > what the current version is.[/color]

    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.java Enabled() && typeof java != 'undefined') {
    alert(
    'java.version: ' + java.lang.Syste m.getProperty(' java.version')
    + '\n'
    + 'java.vendor: ' + java.lang.Syste m.getProperty(' java.vendor'))
    }

    But that will start up the Java VM.

    You could also look into navigator.plugi ns:

    var pluginName = 'Java Plug-in';
    for (var i = 0; i < navigator.plugi ns.length; i++) {
    var plugin = navigator.plugi ns[i];
    if (plugin.name == pluginName) {
    alert(plugin.de scription);
    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.plugi ns array.



    --

    Martin Honnen


    Comment

    Working...