Jan 22, 2004 #1 tictaclam Programmer Joined Jan 8, 2004 Messages 47 Location US Is there any way in java code to find out what version of JRE the user is running? ~tictac~
Jan 22, 2004 Thread starter #3 tictaclam Programmer Joined Jan 8, 2004 Messages 47 Location US I mean in the code itself. I need to determine what version they are running to set a switch in my code. Upvote 0 Downvote
I mean in the code itself. I need to determine what version they are running to set a switch in my code.
Jan 22, 2004 #4 sedj Programmer Joined Aug 6, 2002 Messages 5,610 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"); Upvote 0 Downvote
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");
Jan 22, 2004 Thread starter #5 tictaclam Programmer Joined Jan 8, 2004 Messages 47 Location US Thanks that's exactly what I needed! Upvote 0 Downvote