code: @CheckForNull
      @Restricted(NoExternalUse.class)
      public String checkJavaVersion(final PrintStream logger, String javaCommand,
                                        final BufferedReader r, final StringWriter output) throws IOException {
          String line;
          while (null != (line = r.readLine())) {
              output.write(line);
              output.write("\n");
              line = line.toLowerCase(Locale.ENGLISH);
              if (line.startsWith("java version \"") || line.startsWith("openjdk version \"")) {
                  final String versionStr = line.substring(line.indexOf('\"') + 1, line.lastIndexOf('\"'));
                  logger.println(Messages.SSHLauncher_JavaVersionResult(SSHLauncher.getTimestamp(), javaCommand, versionStr));
  
                  // parse as a number and we should be OK as all we care about is up through the first dot.
                  final VersionNumber minJavaLevel = JavaProvider.getMinJavaLevel();
                  try {
                      final Number version = NumberFormat.getNumberInstance(Locale.US).parse(versionStr);
                      //TODO: burn it with fire
                      if(version.doubleValue() < Double.parseDouble("1."+minJavaLevel)) {
                          throw new IOException(Messages.SSHLauncher_NoJavaFound2(line, minJavaLevel.toString()));
                      }
                  } catch(final ParseException e) {
                      throw new IOException(Messages.SSHLauncher_NoJavaFound2(line, minJavaLevel));
                  }
                  return javaCommand;
              }
          }
          return null;
      }
docs: Given the output of "java -version" in <code>r</code>, determine if this
  version of Java is supported.
  
  @param logger
  where to log the output
  @param javaCommand
  the command executed, used for logging
  @param r
  the output of "java -version"
  @param output
  copy the data from <code>r</code> into this output buffer