org.compass.core.util
Class JdkVersion

java.lang.Object
  extended by org.compass.core.util.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:
kimchy

Field Summary
static int JAVA_13
           
static int JAVA_14
           
static int JAVA_15
           
static int JAVA_16
           
static int JAVA_17
           
 
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

JAVA_16

public static final int JAVA_16
See Also:
Constant Field Values

JAVA_17

public static final int JAVA_17
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) 2004-2008 The Compass Project.