public class

Version

extends Object
java.lang.Object
   ↳ sun.misc.Version

Summary

Public Constructors
Version()
Public Methods
static String getJdkSpecialVersion()
static String getJvmSpecialVersion()
static void init()
synchronized static int jdkBuildNumber()
Returns the build number of the running JDK if it's a RE build It will return 0 if it's an internal build.
synchronized static int jdkMajorVersion()
Returns the major version of the running JDK.
synchronized static int jdkMicroVersion()
Returns the micro version of the running JDK.
synchronized static int jdkMinorVersion()
Returns the minor version of the running JDK.
synchronized static String jdkSpecialVersion()
synchronized static int jdkUpdateVersion()
Returns the update release version of the running JDK if it's a RE build.
synchronized static int jvmBuildNumber()
Returns the build number of the running JVM if it's a RE build It will return 0 if it's an internal build.
synchronized static int jvmMajorVersion()
Returns the major version of the running JVM if it's 1.6 or newer or any RE VM build.
synchronized static int jvmMicroVersion()
Returns the micro version of the running JVM if it's 1.6 or newer or any RE VM build.
synchronized static int jvmMinorVersion()
Returns the minor version of the running JVM if it's 1.6 or newer or any RE VM build.
synchronized static String jvmSpecialVersion()
synchronized static int jvmUpdateVersion()
Returns the update release version of the running JVM if it's a RE build.
static void print(PrintStream ps)
Give a stream, it will print version info on it.
static void print()
In case you were wondering this method is called by java -version.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Version ()

Public Methods

public static String getJdkSpecialVersion ()

public static String getJvmSpecialVersion ()

public static void init ()

public static synchronized int jdkBuildNumber ()

Returns the build number of the running JDK if it's a RE build It will return 0 if it's an internal build.

public static synchronized int jdkMajorVersion ()

Returns the major version of the running JDK.

public static synchronized int jdkMicroVersion ()

Returns the micro version of the running JDK.

public static synchronized int jdkMinorVersion ()

Returns the minor version of the running JDK.

public static synchronized String jdkSpecialVersion ()

public static synchronized int jdkUpdateVersion ()

Returns the update release version of the running JDK if it's a RE build. It will return 0 if it's an internal build.

public static synchronized int jvmBuildNumber ()

Returns the build number of the running JVM if it's a RE build It will return 0 if it's an internal build.

public static synchronized int jvmMajorVersion ()

Returns the major version of the running JVM if it's 1.6 or newer or any RE VM build. It will return 0 if it's an internal 1.5 or 1.4.x build.

public static synchronized int jvmMicroVersion ()

Returns the micro version of the running JVM if it's 1.6 or newer or any RE VM build. It will return 0 if it's an internal 1.5 or 1.4.x build.

public static synchronized int jvmMinorVersion ()

Returns the minor version of the running JVM if it's 1.6 or newer or any RE VM build. It will return 0 if it's an internal 1.5 or 1.4.x build.

public static synchronized String jvmSpecialVersion ()

public static synchronized int jvmUpdateVersion ()

Returns the update release version of the running JVM if it's a RE build. It will return 0 if it's an internal build.

public static void print (PrintStream ps)

Give a stream, it will print version info on it.

public static void print ()

In case you were wondering this method is called by java -version. Sad that it prints to stderr; would be nicer if default printed on stdout.