Class Jvm

java.lang.Object
spock.util.environment.Jvm

public class Jvm extends Object
Provides information on the current JVM, such as its Java version.
  • Method Details

    • getJavaVersion

      public String getJavaVersion()
      The Java version, as returned by the java.version system 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.version system property
    • getJavaSpecificationVersion

      public String getJavaSpecificationVersion()
      The Java specification version, as returned by the java.specification.version system property. Examples for valid values are "1.6" and "1.7".
      Returns:
      the Java specification version, as returned by the java.specification.version system 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

      public static Jvm getCurrent()
      Returns the current JVM.
      Returns:
      the current JVM