code: public static double getJavaRunningVersionAsDouble() {
          String version = System.getProperty("java.version");
          int pos = version.indexOf('.');
          pos = version.indexOf('.', pos + 1);
          return Double.parseDouble(version.substring(0, pos));
      }
docs: getJavaRunningVersionAsDouble, Returns a double with the currently running java version.