Package org.eclipse.jetty.start
Class JavaVersion
- java.lang.Object
-
- org.eclipse.jetty.start.JavaVersion
-
public class JavaVersion extends Object
Java Version Utility class.Parses java versions to extract a consistent set of version parts
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMajor()
Returns the major number version, such as1
for JDK 1.8.0_92 and9
for JDK 9.2.4.int
getMicro()
Returns the micro number version, such as0
for JDK 1.8.0_92 and4
for JDK 9.2.4.int
getMinor()
Returns the minor number version, such as8
for JDK 1.8.0_92 and2
for JDK 9.2.4.int
getPlatform()
Returns the Java Platform version, such as8
for JDK 1.8.0_92 and9
for JDK 9.2.4.String
getSuffix()
Returns the remaining string after the version numbers, such as-internal
for JDK 1.8.0_92-internal and-ea
for JDK 9-ea, or+13
for JDK 9.2.4+13.int
getUpdate()
Returns the update number version, such as92
for JDK 1.8.0_92 and0
for JDK 9.2.4.String
getVersion()
static JavaVersion
parse(String version)
-
-
-
Method Detail
-
parse
public static JavaVersion parse(String version)
-
getVersion
public String getVersion()
- Returns:
- the string from which this JavaVersion was created
-
getPlatform
public int getPlatform()
Returns the Java Platform version, such as
8
for JDK 1.8.0_92 and9
for JDK 9.2.4.- Returns:
- the Java Platform version
-
getMajor
public int getMajor()
Returns the major number version, such as
1
for JDK 1.8.0_92 and9
for JDK 9.2.4.- Returns:
- the major number version
-
getMinor
public int getMinor()
Returns the minor number version, such as
8
for JDK 1.8.0_92 and2
for JDK 9.2.4.- Returns:
- the minor number version
-
getMicro
public int getMicro()
Returns the micro number version, such as
0
for JDK 1.8.0_92 and4
for JDK 9.2.4.- Returns:
- the micro number version
-
getUpdate
public int getUpdate()
Returns the update number version, such as
92
for JDK 1.8.0_92 and0
for JDK 9.2.4.- Returns:
- the update number version
-
getSuffix
public String getSuffix()
Returns the remaining string after the version numbers, such as
-internal
for JDK 1.8.0_92-internal and-ea
for JDK 9-ea, or+13
for JDK 9.2.4+13.- Returns:
- the remaining string after the version numbers
-
-