code: static int getMajorJavaVersion(String javaVersion) {
      int version = parseDotted(javaVersion);
      if (version == -1) {
        version = extractBeginningInt(javaVersion);
      }
      if (version == -1) {
        return 6;  // Choose minimum supported JDK version as default
      }
      return version;
    }
docs: Visible for testing only