Package org.eclipse.jetty.util
Class JavaVersion
java.lang.Object
org.eclipse.jetty.util.JavaVersion
Java Version Utility class.
Parses java versions to extract a consistent set of version parts
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringContext attribute that can be set to target a different version of the jvm than the current runtime.static final JavaVersion -
Method Summary
Modifier and TypeMethodDescriptionintgetMajor()Returns the major number version, such as1for JDK 1.8.0_92 and9for JDK 9.2.4.intgetMicro()Returns the micro number version (aka security number), such as0for JDK 1.8.0_92 and4for JDK 9.2.4.intgetMinor()Returns the minor number version, such as8for JDK 1.8.0_92 and2for JDK 9.2.4.intReturns the Java Platform version, such as8for JDK 1.8.0_92 and9for JDK 9.2.4.static JavaVersiontoString()
-
Field Details
-
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().- See Also:
-
VERSION
-
-
Method Details
-
parse
-
getVersion
- Returns:
- the string from which this JavaVersion was created
-
getPlatform
public int getPlatform()Returns the Java Platform version, such as
8for JDK 1.8.0_92 and9for JDK 9.2.4.- Returns:
- the Java Platform version
-
getMajor
public int getMajor()Returns the major number version, such as
1for JDK 1.8.0_92 and9for JDK 9.2.4.- Returns:
- the major number version
-
getMinor
public int getMinor()Returns the minor number version, such as
8for JDK 1.8.0_92 and2for JDK 9.2.4.- Returns:
- the minor number version
-
getMicro
public int getMicro()Returns the micro number version (aka security number), such as
0for JDK 1.8.0_92 and4for JDK 9.2.4.- Returns:
- the micro number version
-
toString
-