Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

quick question JRE 1

Status
Not open for further replies.

tictaclam

Programmer
Jan 8, 2004
47
US
Is there any way in java code to find out what version of JRE the user is running?
~tictac~
 
I mean in the code itself. I need to determine what version they are running to set a switch in my code.
 
This code lists all the System properties and their values :

Code:
     for (java.util.Enumeration e = System.getProperties().propertyNames() ; e.hasMoreElements() ;) {
		 String n = (String)e.nextElement();
         System.out.println(n +":" +System.getProperty(n));
     }

You will probably want to use this property :

Code:
String jrevm = System.getProperty("java.vm.version");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top