private static @Nullable JdkVersionInfo detectFromOutput(String homePath, ExecutorService runner) {
    Path javaExe = Paths.get(homePath, "bin/" + (SystemInfo.isWindows ? "java.exe" : "java"));
    if (Files.isExecutable(javaExe)) {
      try {
        Process process = new ProcessBuilder(javaExe.toString(), "-version").redirectErrorStream(true).start();
        VersionOutputReader reader = new VersionOutputReader(process.getInputStream(), runner);
        try {
          reader.waitFor();
        }
        catch (InterruptedException e) {
          LOG.info(e);
          process.destroy();
        }

        List<String> lines = reader.myLines;
        while (!lines.isEmpty() && lines.get(0).startsWith("Picked up ")) {
          lines.remove(0);
        }
        if (!lines.isEmpty()) {
          JavaVersion base = JavaVersion.parse(lines.get(0));
          JavaVersion rt = JavaVersion.tryParse(lines.size() > 2 ? lines.get(1) : null);
          JavaVersion version = rt != null && rt.feature == base.feature && rt.minor == base.minor ? rt : base;
          return new JdkVersionInfo(version, null, CpuArch.UNKNOWN, null);
        }
      }
      catch (IOException | IllegalArgumentException e) {
        LOG.info(javaExe.toString(), e);
      }
    }

    return null;
  }
private static @Nullable JdkVersionInfo detectFromOutput(String homePath, ExecutorService runner)