public final class JavaVersion
extends java.lang.Object
<major>.<minor> format.| Modifier and Type | Field and Description |
|---|---|
static char |
PATCH_SEPARATOR
JavaEE platform patch version element separator character.
|
static char |
SEPARATOR
JavaEE platform version elements separator character.
|
| Constructor and Description |
|---|
JavaVersion(int major,
int minor)
Constructs an instance of Java specification version number.
|
| Modifier and Type | Method and Description |
|---|---|
int |
comapreTo(JavaVersion version)
Compares this
JavaVersion object against another one. |
int |
getMajor()
Get major version number.
|
int |
getMinor()
Get minor version number.
|
JavaSEPlatform |
toPlatform()
Return
JavaSEPlatform matching this Java SE specification version. |
java.lang.String |
toString()
Return
String representation of Java VM version object. |
static JavaVersion |
vmVersion()
Java specification version detector.
|
static java.lang.String |
vmVersionString()
Retrieves Java specification version
String from JDK system property. |
public static final char SEPARATOR
public static final char PATCH_SEPARATOR
public JavaVersion(int major,
int minor)
major - Major version number.minor - Minor version number.public static java.lang.String vmVersionString()
String from JDK system property.String from JDK system property.public static JavaVersion vmVersion()
"MA.MI"
java version is parsed as non case sensitive.public final int getMajor()
public final int getMinor()
public final int comapreTo(JavaVersion version)
JavaVersion object against another one.version - JavaVersion object to compare with
this object.1 if this value
is greater than supplied version value.
Value -1 if this value
is lesser than supplied version value.
Value 0 if both this value
and supplied version values are equal.
public final java.lang.String toString()
String representation of Java VM version object.toString in class java.lang.Objectpublic final JavaSEPlatform toPlatform()
JavaSEPlatform matching this Java SE specification version.JavaSEPlatform matching this Java SE specification version.EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference