public boolean isJavaVersion(int majorJavaVersion) {
    if (majorJavaVersion == 8) {
      return isJava8();
    } else {
      return javaSpecVersionNumber.getMajor() == majorJavaVersion;
    }
  }
Tells whether the Java version is equal to the given major Java version.

@since 2.0
@param majorJavaVersion major java version (e.g. 8, 12, 17) to check the Java version is equal to
@return whether the Java version is equal to the given major Java version
spock-core/src/main/java/spock/util/environment/Jvm.java