aspose file tools*
The moose likes Java in General and the fly likes How to detect the JVM version of the browser like IE or Netscape navigator? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to detect the JVM version of the browser like IE or Netscape navigator?" Watch "How to detect the JVM version of the browser like IE or Netscape navigator?" New topic
Author

How to detect the JVM version of the browser like IE or Netscape navigator?

Shashi Kanta
Ranch Hand

Joined: May 08, 2002
Posts: 89
Hi,
How to detect the JVM version of the browser like IE or Netscape navigator? or if at all JVM is present? Either JavaScript or Applet should be used to find out the JVM version.
Thanks.
Shashikanta
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
See http://java.sun.com/j2se/1.3/docs/api/java/lang/System.html, the getProperties method.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Shashi Kanta
Ranch Hand

Joined: May 08, 2002
Posts: 89
Hi,
Yes, we can use System.getProperty("java.vm.version") to get the JVM version.
But, isn't that the JVM version for the JDK installed on your machine? Also, when I try to access my applet which invokes this property, on some machine that doesn't have JDK installed, it throws Security Exception.
regards,
Shashi
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
But, isn't that the JVM version for the JDK installed on your machine?

Shashi,
This is quite browser dependent. M$ Internet Explorer comes with a built-in Virtual Machine (actually, it is probably part of the Windows OS). The MS VM is stuck at Java version 1.1.4, due to their legal scuffles with Sun. The IE browser can also use Sun's Java Plugin, which provides the very latest version of VM.
The old Netscape version 4 browsers also came with a built-in JVM. Netscape 4.7x browsers had a Java 1.1.7 JVM.
Mozilla was developed without an internal JVM, and has always relied on the Sun plugin for Java functionality. Netscape 6.0, 6.1 and 7.0 also are like this, but they do ship with a plugin pre-installed.
The latest Sun plugins will ask on installation if they should be made availabel to IE5 and Netscape 6+ browsers.
I don't know how Opera gets Java capability, but I suspect it also uses a third-party plugin.
Also, when I try to access my applet which invokes this property, on some machine that doesn't have JDK installed, it throws Security Exception.

This is probably in an Internet Explorer browser with the default MS VM.
Try getting an Enumeration of the System properties and listing them to see what you actually have available to you.
PCS


Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
Have you seen this thread? It may help.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to detect the JVM version of the browser like IE or Netscape navigator?