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_1
          The integer for java 1.1 versions of the JVM.
static int VERSION_2
          The integer for java 1.2 versions of the JVM.
static int VERSION_3
          The integer for java 1.3 versions of the JVM.
static int VERSION_4
          The integer for java 1.4 versions of the JVM.
static int VERSION_5
          The integer for java 5 versions of the JVM.
static int VERSION_6
          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_1

public static final int VERSION_1
The integer for java 1.1 versions of the JVM.

See Also:
Constant Field Values

VERSION_2

public static final int VERSION_2
The integer for java 1.2 versions of the JVM.

See Also:
Constant Field Values

VERSION_3

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

See Also:
Constant Field Values

VERSION_4

public static final int VERSION_4
The integer for java 1.4 versions of the JVM.

See Also:
Constant Field Values

VERSION_5

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

See Also:
Constant Field Values

VERSION_6

public static final int VERSION_6
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_1, VERSION_2, VERSION_3, VERSION_4, VERSION_5 or VERSION_6.
Throws:
java.lang.IllegalStateException - If the system property java.vm.version does not start with VERSION_STRING_1, VERSION_STRING_2, VERSION_STRING_3, VERSION_STRING_4, VERSION_STRING_5 or VERSION_STRING_6.