org.springframework.core
Class JdkVersion

java.lang.Object
  extended by org.springframework.core.JdkVersion

public class JdkVersion
extends Object

Helper class used to find the current Java/JDK version. Usually we want to find if we're in a 1.4 or higher JVM. (Spring does not support 1.2 JVMs.)

Author:
Rod Johnson, Juergen Hoeller

Field Summary
static int JAVA_13
           
static int JAVA_14
           
static int JAVA_15
           
 
Constructor Summary
JdkVersion()
           
 
Method Summary
static String getJavaVersion()
          Return the full Java version string, as returned by System.getProperty("java.version").
static int getMajorJavaVersion()
          Get the major version code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_13

public static final int JAVA_13
See Also:
Constant Field Values

JAVA_14

public static final int JAVA_14
See Also:
Constant Field Values

JAVA_15

public static final int JAVA_15
See Also:
Constant Field Values
Constructor Detail

JdkVersion

public JdkVersion()
Method Detail

getJavaVersion

public static String getJavaVersion()
Return the full Java version string, as returned by System.getProperty("java.version").


getMajorJavaVersion

public static int getMajorJavaVersion()
Get the major version code. This means we can do things like if (getMajorJavaVersion() < JAVA_14).

Returns:
a code comparable to the JAVA_XX codes in this class
See Also:
JAVA_13, JAVA_14, JAVA_15


Copyright (c) 2002-2005 The Spring Framework Project.