<major>.<minor> format.
| Modifier and Type | Field and Description |
|---|---|
| private final int | major
Major version number. |
| private final int | minor
Minor version number. |
| public static final char | PATCH_SEPARATOR
JavaEE platform patch version element separator character. |
| private static final String | RUNTIME_VERSION_METHOD_NAME
JDK 9+ java.lang.Runtime static version() method name. |
| public static final char | SEPARATOR
JavaEE platform version elements separator character. |
| private static final String | VERSION_CLASS_NAME
JDK 9+ java.lang.Runtime.Version class name. |
| private static final int | VM_MIN_VERSION_TOKENS
Number of |
| private static final Pattern | VM_VERSION_PATTERN
Compiled regular expression pattern to read individual version number components. |
| public static final String | VM_VERSION_PROPERTY
Java VM version system property name. |
| Access | Constructor and Description |
|---|---|
| public | JavaVersion(final int
Major version number. major, final int Minor version number. minor)Constructs an instance of Java specification version number. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: Compare result:
JavaVersion object to compare with
this object.Compares this |
| public int | |
| public int | |
| private static Integer | getRuntimeVersionNumber(final Object
Runtime.Version class instance containing JDK version information.name of name)Runtime.Version instance method to invoke.Invoke |
| private static JavaVersion | Returns: Current JDK version for any JDK from system property.Retrieve Java specification version from JDK system property. |
| private static JavaVersion | Returns: Current JDK version for any JDK from system property.Parse Java specification version from JDK system property provided as an argument. |
| private static JavaVersion | Returns: Current JDK version for JDK 9 and later ornull otherwise or when any problem with version retrieval happened.Retrieve JDK version numbers from |
| private static Object | Returns: Runtime.Version instance for JDK 9 and later or null otherwise.Invoke |
| public JavaSEPlatform | Returns: JavaSEPlatform matching this Java SE specification version
or JavaSEPlatform.DEFAULT as default when platform matching fails.Return |
| public String | Returns: Java VM version string.Overrides java. String representation of Java VM version object.
|
| public static JavaVersion | |
| public static String | Returns: Java specification version String from JDK system property.Retrieves Java specification version String from JDK system property. |
| major | back to summary |
|---|---|
| private final int major Major version number. | |
| minor | back to summary |
|---|---|
| private final int minor Minor version number. | |
| PATCH_SEPARATOR | back to summary |
|---|---|
| public static final char PATCH_SEPARATOR JavaEE platform patch version element separator character. | |
| RUNTIME_VERSION_METHOD_NAME | back to summary |
|---|---|
| private static final String RUNTIME_VERSION_METHOD_NAME JDK 9+ java.lang.Runtime static version() method name. | |
| SEPARATOR | back to summary |
|---|---|
| public static final char SEPARATOR JavaEE platform version elements separator character. | |
| VERSION_CLASS_NAME | back to summary |
|---|---|
| private static final String VERSION_CLASS_NAME JDK 9+ java.lang.Runtime.Version class name. | |
| VM_MIN_VERSION_TOKENS | back to summary |
|---|---|
| private static final int VM_MIN_VERSION_TOKENS Number of | |
| VM_VERSION_PATTERN | back to summary |
|---|---|
| private static final Pattern VM_VERSION_PATTERN Compiled regular expression pattern to read individual version number components.
Expected input is string like | |
| VM_VERSION_PROPERTY | back to summary |
|---|---|
| public static final String VM_VERSION_PROPERTY Java VM version system property name. | |
| JavaVersion | back to summary |
|---|---|
| public JavaVersion(final int major, final int minor) Constructs an instance of Java specification version number.
| |
| comapreTo | back to summary |
|---|---|
| public int comapreTo(final JavaVersion version) Compares this
| |
| getMajor | back to summary |
|---|---|
| public int getMajor() Get major version number.
| |
| getMinor | back to summary |
|---|---|
| public int getMinor() Get minor version number.
| |
| getRuntimeVersionNumber | back to summary |
|---|---|
| private static Integer getRuntimeVersionNumber(final Object vObj, final String name) Invoke | |
| propertyVersion | back to summary |
|---|---|
| private static JavaVersion propertyVersion() Retrieve Java specification version from JDK system property.
| |
| propertyVersionParser | back to summary |
|---|---|
| private static JavaVersion propertyVersionParser(final String version) Parse Java specification version from JDK system property provided as an argument. Version string should look like:
java version is parsed as non case sensitive.
| |
| runtimeVersion | back to summary |
|---|---|
| private static JavaVersion runtimeVersion() Retrieve JDK version numbers from
| |
| runtimeVersionObject | back to summary |
|---|---|
| private static Object runtimeVersionObject() Invoke
| |
| toPlatform | back to summary |
|---|---|
| public JavaSEPlatform toPlatform() Return
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Return | |
| vmVersion | back to summary |
|---|---|
| public static JavaVersion vmVersion() Java specification version detector. | |
| vmVersionString | back to summary |
|---|---|
| public static String vmVersionString() Retrieves Java specification version String from JDK system property.
| |