title: Why does Process.waitFor() never return?
body: <p>I am launching a windows process (wrote in C++ but I don't have sources) from Java code in the following way:</p>
  
  <pre><code> Process p1 = Runtime.getRuntime().exec(cmdAndParams);
   p1.waitFor();
  </code></pre>
  
  <p>My problem is that the waitFor() method never ends. Thus I tried to launch the process in a simple shell and it ends correctly with many print in the shell (standard output I guess).</p>
  
  <p>Thus I decided to create and start a thread reading the standard output even if I don't need for now these outputs. This fixed the issue.</p>
  
  <p>So my question is the following one: Is this solution the "Java standard to launch and wait for external processes having outputs" or does it means there is an issue somewhere in the native process ? If such an issue exist what C++ programming "error" can be at the origin of the issue ? </p>