@API(status=STABLE, since="5.1") public enum JRE extends Enum<JRE>
If the current JRE version cannot be detected — for example, if the
java.version
JVM system property is undefined — then none of
the constants defined in this enum will be considered to be the
current JRE version.
EnabledOnJre
,
DisabledOnJre
Enum Constant and Description |
---|
JAVA_10
Java 10.
|
JAVA_11
Java 11.
|
JAVA_8
Java 8.
|
JAVA_9
Java 9.
|
OTHER
|
Modifier and Type | Method and Description |
---|---|
boolean |
isCurrentVersion() |
static JRE |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static JRE[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JRE JAVA_8
public static final JRE JAVA_9
public static final JRE JAVA_10
public static final JRE JAVA_11
public static final JRE OTHER
public static JRE[] values()
for (JRE c : JRE.values()) System.out.println(c);
public static JRE valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isCurrentVersion()
true
if this JRE
is known to be the
Java Runtime Environment version for the currently executing JVMCopyright © 2020. All rights reserved.