Running comand line program inside java program
<p>Im trying to run a program that takes a long time to finish inside a java program. The program inside the java program outputs a huge file (somewhere between 4 to 6 GB). I use the following code inside the main method.</p>

<pre><code>//get the runtime goinog
Runtime rt = Runtime.getRuntime();
//execute program
Process pr = rt.exec("theProgram.exe");
//wqit forprogram to finish
pr.waitFor();
</code></pre>

<p>I get a number of errors:</p>

<ul>
<li>when the java program ends theProgram.exe does not stop sometimes the</li>
<li>java program never ends even when theProgram.exe has ended</li>
<li>theProgram.exe stops without finishing, and the java program does not stop.</li>
</ul>

<p>More information:</p>

<ul>
<li>I'm using cygwin in Windows7</li>
</ul>
