public class Jvm
extends java.lang.Object
Modifier and Type | Method | Description |
---|---|---|
static Jvm |
getCurrent() |
Returns the current JVM.
|
java.lang.String |
getJavaSpecificationVersion() |
The Java specification version, as returned by the
java.specification.version system property. |
java.lang.String |
getJavaVersion() |
The Java version, as returned by the
java.version system property. |
boolean |
isJava10() |
Tells whether the Java version is 10.
|
boolean |
isJava10Compatible() |
Tells whether the Java version is compatible with Java 10.
|
boolean |
isJava11() |
Tells whether the Java version is 11.
|
boolean |
isJava11Compatible() |
Tells whether the Java version is compatible with Java 11.
|
boolean |
isJava5() |
Tells whether the Java version is 5.
|
boolean |
isJava5Compatible() |
Tells whether the Java version is compatible with Java 5.
|
boolean |
isJava6() |
Tells whether the Java version is 6.
|
boolean |
isJava6Compatible() |
Tells whether the Java version is compatible with Java 6.
|
boolean |
isJava7() |
Tells whether the Java version is 7.
|
boolean |
isJava7Compatible() |
Tells whether the Java version is compatible with Java 7.
|
boolean |
isJava8() |
Tells whether the Java version is 8.
|
boolean |
isJava8Compatible() |
Tells whether the Java version is compatible with Java 8.
|
boolean |
isJava9() |
Tells whether the Java version is 9.
|
boolean |
isJava9Compatible() |
Tells whether the Java version is compatible with Java 9.
|
public java.lang.String getJavaVersion()
java.version
system property.
Examples for valid values (for Oracle/OpenJDK) are "1.6.0_22"
and "1.7.0_07"
.java.version
system propertypublic java.lang.String getJavaSpecificationVersion()
java.specification.version
system property.
Examples for valid values are "1.6"
and "1.7"
.java.specification.version
system propertypublic boolean isJava5()
public boolean isJava6()
public boolean isJava7()
public boolean isJava8()
public boolean isJava9()
public boolean isJava10()
public boolean isJava11()
public boolean isJava5Compatible()
public boolean isJava6Compatible()
public boolean isJava7Compatible()
public boolean isJava8Compatible()
public boolean isJava9Compatible()
public boolean isJava10Compatible()
public boolean isJava11Compatible()
public static Jvm getCurrent()