Enum Class JRE
- All Implemented Interfaces:
Serializable
,Comparable<JRE>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterDeprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterDeprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterDeprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterDeprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterDeprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterJava 17.Java 18.Java 19.Java 20.Java 21.Java 22.Java 23.Java 24.Java 25.Java 26.Deprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterDeprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterAn undefined JRE version. -
Method Summary
Modifier and TypeMethodDescriptionstatic JRE
static JRE
Deprecated.in favor ofcurrentJre()
static int
Returns the version number for the currently executing JVM, or-1
if the current JVM version could not be determined.boolean
Returnstrue
if thisJRE
is known to be the Java Runtime Environment version for the currently executing JVM or if the version isOTHER
.static boolean
isCurrentVersion
(int version) Returnstrue
if the supplied version number is known to be the Java Runtime Environment version for the currently executing JVM or if the supplied version number is-1
and the current JVM version could not be determined.static JRE
Returns the enum constant of this class with the specified name.static JRE[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.int
version()
Get the version of thisJRE
.
-
Enum Constant Details
-
UNDEFINED
-
JAVA_8
@API(status=DEPRECATED, since="6.0") @Deprecated(since="6.0", forRemoval=true) public static final JRE JAVA_8Deprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterJava 8. -
JAVA_9
@API(status=DEPRECATED, since="6.0") @Deprecated(since="6.0", forRemoval=true) public static final JRE JAVA_9Deprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterJava 9. -
JAVA_10
@API(status=DEPRECATED, since="6.0") @Deprecated(since="6.0", forRemoval=true) public static final JRE JAVA_10Deprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterJava 10. -
JAVA_11
@API(status=DEPRECATED, since="6.0") @Deprecated(since="6.0", forRemoval=true) public static final JRE JAVA_11Deprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterJava 11. -
JAVA_12
@API(status=DEPRECATED, since="6.0") @Deprecated(since="6.0", forRemoval=true) public static final JRE JAVA_12Deprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterJava 12.- Since:
- 5.4
-
JAVA_13
@API(status=DEPRECATED, since="6.0") @Deprecated(since="6.0", forRemoval=true) public static final JRE JAVA_13Deprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterJava 13.- Since:
- 5.4
-
JAVA_14
@API(status=DEPRECATED, since="6.0") @Deprecated(since="6.0", forRemoval=true) public static final JRE JAVA_14Deprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterJava 14.- Since:
- 5.5
-
JAVA_15
@API(status=DEPRECATED, since="6.0") @Deprecated(since="6.0", forRemoval=true) public static final JRE JAVA_15Deprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterJava 15.- Since:
- 5.6
-
JAVA_16
@API(status=DEPRECATED, since="6.0") @Deprecated(since="6.0", forRemoval=true) public static final JRE JAVA_16Deprecated, for removal: This API element is subject to removal in a future version.No longer supported at runtime; please useJAVA_17
or laterJava 16.- Since:
- 5.7
-
JAVA_17
-
JAVA_18
-
JAVA_19
-
JAVA_20
-
JAVA_21
-
JAVA_22
-
JAVA_23
-
JAVA_24
-
JAVA_25
-
JAVA_26
-
OTHER
A JRE version other thanJAVA_8
,JAVA_9
,JAVA_10
,JAVA_11
,JAVA_12
,JAVA_13
,JAVA_14
,JAVA_15
,JAVA_16
,JAVA_17
,JAVA_18
,JAVA_19
,JAVA_20
,JAVA_21
,JAVA_22
,JAVA_23
,JAVA_24
,JAVA_25
, orJAVA_26
.This constant returns
Integer.MAX_VALUE
for its version. To retrieve the actual version number, usecurrentVersionNumber()
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
version
Get the version of thisJRE
.If this
JRE
isUNDEFINED
, this method returns-1
. If thisJRE
isOTHER
, this method returnsInteger.MAX_VALUE
.- Returns:
- the version of this
JRE
- Since:
- 5.12
- See Also:
-
isCurrentVersion
public boolean isCurrentVersion()Returnstrue
if thisJRE
is known to be the Java Runtime Environment version for the currently executing JVM or if the version isOTHER
.- Returns:
true
if thisJRE
is known to be the Java Runtime Environment version for the currently executing JVM or if the version isOTHER
- See Also:
-
currentVersion
Deprecated.in favor ofcurrentJre()
-
currentJre
-
currentVersionNumber
Returns the version number for the currently executing JVM, or-1
if the current JVM version could not be determined.- Returns:
- the version number for the currently executing JVM, or
-1
if the current JVM version could not be determined - Since:
- 5.12
- See Also:
-
isCurrentVersion
Returnstrue
if the supplied version number is known to be the Java Runtime Environment version for the currently executing JVM or if the supplied version number is-1
and the current JVM version could not be determined.- Returns:
true
if the supplied version number is known to be the Java Runtime Environment version for the currently executing JVM or if the supplied version number is-1
and the current JVM version could not be determined- Since:
- 5.12
- See Also:
-
JAVA_17
or later