title: Output from Java Process is always empty
body: <p>I'm running a simple unit test to output the version of Java using an external Process. The output appears in the console and the process runs successfully but the output is always empty when calling getInputStream(). I don't understand why.</p>
  
  <pre><code>@Test
  public void testProcess() throws IOException, InterruptedException, ExecutionException {
      ProcessBuilder processBuilder = new ProcessBuilder("java", "-version");
      processBuilder.inheritIO();
      processBuilder.redirectErrorStream(true);
  
      Process process = processBuilder.start();
      int exitCode = process.waitFor();
      assertEquals("No errors should be detected", 0, exitCode);
  
      BufferedReader output = new BufferedReader(new InputStreamReader(process.getInputStream()));
      List&lt;String&gt; results = output.lines()
          .collect(Collectors.toList());
  
      // This line always fails
      assertThat("Result should not be empty", results, is(not(empty())));
      assertThat("Result should contain java version: ", results, hasItem(containsString("java version")));
  
      //result.forEach(LOG::info);
  
  }
  </code></pre>
  
  <p>The results are always empty, even though when running the test in eclipse the command is run and the version is displayed in the console.</p>
  
  <p>I'm just experimenting a bit with processbuilder and process. I've seen in some examples reading the response in a different thread, but it doesn't make any difference. It always fails. Likewise, if I include calls to inheritIO and redirectErrorStream it makes no difference.</p>
  
  <p>Thanks.</p>