org.springframework.core
Class JdkVersion
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
JdkVersion
public JdkVersion()
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-2006 The Spring Framework Project.