Package spock.util.environment
Class Jvm
java.lang.Object
spock.util.environment.Jvm
Provides information on the current JVM, such as its Java version.
-
Method Summary
Modifier and TypeMethodDescriptionstatic JvmReturns the current JVM.The Java specification version, as returned by thejava.specification.versionsystem property.The Java version, as returned by thejava.versionsystem property.booleanisJava5()Tells whether the Java version is 5.booleanTells whether the Java version is compatible with Java 5.booleanisJava6()Tells whether the Java version is 6.booleanTells whether the Java version is compatible with Java 6.booleanisJava7()Tells whether the Java version is 7.booleanTells whether the Java version is compatible with Java 7.booleanisJava8()Tells whether the Java version is 8.booleanTells whether the Java version is compatible with Java 8.booleanisJava9()Tells whether the Java version is 9.booleanTells whether the Java version is compatible with Java 9.
-
Method Details
-
getJavaVersion
The Java version, as returned by thejava.versionsystem property. Examples for valid values (for Oracle/OpenJDK) are"1.6.0_22"and"1.7.0_07".- Returns:
- the Java version, as returned by the
java.versionsystem property
-
getJavaSpecificationVersion
The Java specification version, as returned by thejava.specification.versionsystem property. Examples for valid values are"1.6"and"1.7".- Returns:
- the Java specification version, as returned by the
java.specification.versionsystem property
-
isJava5
public boolean isJava5()Tells whether the Java version is 5.- Returns:
- whether the Java version is 5
-
isJava6
public boolean isJava6()Tells whether the Java version is 6.- Returns:
- whether the Java version is 6
-
isJava7
public boolean isJava7()Tells whether the Java version is 7.- Returns:
- whether the Java version is 7
-
isJava8
public boolean isJava8()Tells whether the Java version is 8.- Returns:
- whether the Java version is 8
-
isJava9
public boolean isJava9()Tells whether the Java version is 9.- Returns:
- whether the Java version is 9
-
isJava5Compatible
public boolean isJava5Compatible()Tells whether the Java version is compatible with Java 5.- Returns:
- whether the Java version is compatible with Java 5
-
isJava6Compatible
public boolean isJava6Compatible()Tells whether the Java version is compatible with Java 6.- Returns:
- whether the Java version is compatible with Java 6
-
isJava7Compatible
public boolean isJava7Compatible()Tells whether the Java version is compatible with Java 7.- Returns:
- whether the Java version is compatible with Java 7
-
isJava8Compatible
public boolean isJava8Compatible()Tells whether the Java version is compatible with Java 8.- Returns:
- whether the Java version is compatible with Java 8
-
isJava9Compatible
public boolean isJava9Compatible()Tells whether the Java version is compatible with Java 9.- Returns:
- whether the Java version is compatible with Java 9
-
getCurrent
Returns the current JVM.- Returns:
- the current JVM
-