Top Description Fields Constructors Methods
org.eclipse.jetty.util

public Class JavaVersion

extends Object
Class Inheritance

Java Version Utility class.

Parses java versions to extract a consistent set of version parts

Field Summary

Modifier and TypeField and Description
public static final String
JAVA_TARGET_PLATFORM

Context attribute that can be set to target a different version of the jvm than the current runtime.

private final int
private final int
private final int
private final int
public static final JavaVersion
private final String

Constructor Summary

AccessConstructor and Description
private
JavaVersion(String version, int platform, int major, int minor, int micro)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the major number version
getMajor
()

Returns the major number version, such as 1 for JDK 1.8.0_92 and 9 for JDK 9.2.4.

public int

Returns:

the micro number version
getMicro
()

Returns the micro number version (aka security number), such as 0 for JDK 1.8.0_92 and 4 for JDK 9.2.4.

public int

Returns:

the minor number version
getMinor
()

Returns the minor number version, such as 8 for JDK 1.8.0_92 and 2 for JDK 9.2.4.

public int

Returns:

the Java Platform version
getPlatform
()

Returns the Java Platform version, such as 8 for JDK 1.8.0_92 and 9 for JDK 9.2.4.

public String

Returns:

the string from which this JavaVersion was created
getVersion
()

Get the string from which this JavaVersion was created.

public static JavaVersion
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

JAVA_TARGET_PLATFORMback to summary
public static final String JAVA_TARGET_PLATFORM

Context attribute that can be set to target a different version of the jvm than the current runtime. Acceptable values should correspond to those returned by JavaVersion.getPlatform().

majorback to summary
private final int major
microback to summary
private final int micro
minorback to summary
private final int minor
platformback to summary
private final int platform
VERSIONback to summary
public static final JavaVersion VERSION
versionback to summary
private final String version

Constructor Detail

JavaVersionback to summary
private JavaVersion(String version, int platform, int major, int minor, int micro)

Method Detail

getMajorback to summary
public int getMajor()

Returns the major number version, such as 1 for JDK 1.8.0_92 and 9 for JDK 9.2.4.

Returns:int

the major number version

getMicroback to summary
public int getMicro()

Returns the micro number version (aka security number), such as 0 for JDK 1.8.0_92 and 4 for JDK 9.2.4.

Returns:int

the micro number version

getMinorback to summary
public int getMinor()

Returns the minor number version, such as 8 for JDK 1.8.0_92 and 2 for JDK 9.2.4.

Returns:int

the minor number version

getPlatformback to summary
public int getPlatform()

Returns the Java Platform version, such as 8 for JDK 1.8.0_92 and 9 for JDK 9.2.4.

Returns:int

the Java Platform version

getVersionback to summary
public String getVersion()

Get the string from which this JavaVersion was created.

Returns:String

the string from which this JavaVersion was created

parseback to summary
public static JavaVersion parse(String v)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override