spock.util.environment
public class Jvm extends Object
Modifier and Type | Method and Description |
---|---|
static Jvm |
getCurrent()
Returns the current JVM.
|
String |
getJavaSpecificationVersion()
The Java specification version, as returned by the
java.specification.version system property. |
String |
getJavaVersion()
The Java version, as returned by the
java.version system property. |
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 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 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 isJava5Compatible()
public boolean isJava6Compatible()
public boolean isJava7Compatible()
public boolean isJava8Compatible()
public boolean isJava9Compatible()
public static Jvm getCurrent()