code: protected static void checkJavaVersion(final PrintStream logger, String javaCommand,
                                      final BufferedReader r)
              throws IOException {
          String line;
          Pattern p = Pattern.compile("(?i)(?:java|openjdk) version \"([0-9.]+).*\"");
          while (null != (line = r.readLine())) {
              Matcher m = p.matcher(line);
              if (m.matches()) {
                  final String versionStr = m.group(1);
                  logger.println(Messages.ComputerLauncher_JavaVersionResult(javaCommand, versionStr));
                  try {
                      if (new DeweyDecimal(versionStr).isLessThan(new DeweyDecimal("1.8"))) {
                          throw new IOException(Messages
                                  .ComputerLauncher_NoJavaFound(line));
                      }
                  } catch (NumberFormatException x) {
                      throw new IOException(Messages.ComputerLauncher_NoJavaFound(line));
                  }
                  return;
              }
          }
          logger.println(Messages.ComputerLauncher_UnknownJavaVersion(javaCommand));
          throw new IOException(Messages.ComputerLauncher_UnknownJavaVersion(javaCommand));
      }
docs: Given the output of "java -version" in <code>r</code>, determine if this
  version of Java is supported, or throw {@link IOException}.
  
  @param logger
  where to log the output
  @param javaCommand
  the command executed, used for logging
  @param r
  the output of "java -version"