code: protected static int getNumericJavaVersion (String verstr)
      {
          Matcher m = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(_\\d+)?.*").matcher(verstr);
          if (!m.matches()) {
              // if we can't parse the java version we're in weird land and should probably just try
              // our luck with what we've got rather than try to download a new jvm
              log.warning("Unable to parse VM version, hoping for the best [version=" + verstr + "]");
              return 0;
          }
  
          int one = Integer.parseInt(m.group(1)); // will there ever be a two?
          int major = Integer.parseInt(m.group(2));
          int minor = Integer.parseInt(m.group(3));
          int patch = m.group(4) == null ? 0 : Integer.parseInt(m.group(4).substring(1));
          return patch + 100 * (minor + 100 * (major + 100 * one));
      }
docs: Converts the java version string to a more comparable numeric version number.