title: ProcessBuilder redirected to standard output
body: <p>I would like to redirect a java process output towards the standard output of the parent java process.</p>
  
  <p>Using the ProcessBuilder class as follows:</p>
  
  <pre><code>public static void main(String[] args) {
    ProcessBuilder processBuilder = new ProcessBuilder("cmd");
    processBuilder.directory(new File("C:"));   
    processBuilder.redirectErrorStream(true); // redirect error stream to output stream
    processBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
  }
  </code></pre>
  
  <p>I would have expected that the outputs of "cmd", which are like:</p>
  
  <p>Microsoft Windows [version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. Tous droits réservés.</p>
  
  <p>are displayed in the DOS console used to run the java program.
  But nothing is displayed at all in the DOS Console.</p>
  
  <p>In the other threads of discussions, I saw solutions using a BufferedReader class: but here I would like the outputs of the process to be directly displayed in the standard output, without using any BufferedReader or "while reading loop". Is it possible?</p>
  
  <p>Thanks.</p>