com.javadocking.util
Class JvmVersionUtil

java.lang.Object
  extended by com.javadocking.util.JvmVersionUtil

public class JvmVersionUtil
extends java.lang.Object

This class determines the version of the Java Virtual Machine.

Author:
Heidi Rakels.

Field Summary
static int VERSION_3_OR_LESS
          The integer for java 1.3 versions of the JVM.
static int VERSION_4_or_5
          The integer for java 5 versions of the JVM.
static int VERSION_6_OR_MORE
          The integer for java 6 versions of the JVM.
 
Method Summary
static int getVersion()
          Gets the version of the JVM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_3_OR_LESS

public static final int VERSION_3_OR_LESS
The integer for java 1.3 versions of the JVM.

See Also:
Constant Field Values

VERSION_4_or_5

public static final int VERSION_4_or_5
The integer for java 5 versions of the JVM.

See Also:
Constant Field Values

VERSION_6_OR_MORE

public static final int VERSION_6_OR_MORE
The integer for java 6 versions of the JVM.

See Also:
Constant Field Values
Method Detail

getVersion

public static int getVersion()
Gets the version of the JVM.

Returns:
The integer that corresponds with the version of the JVM. This can be VERSION_3_OR_LESS,VERSION_4_or_5, VERSION_6_OR_MORE.
Throws:
java.lang.IllegalStateException - If the system property java.version does not start with a x.x. x should be a number.