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.
//get the runtime goinog
Runtime rt = Runtime.getRuntime();
//execute program
Process pr = rt.exec("theProgram.exe");
//wqit forprogram to finish
pr.waitFor();
I get a number of errors:
- when the java program ends theProgram.exe does not stop sometimes the
- java program never ends even when theProgram.exe has ended
- theProgram.exe stops without finishing, and the java program does not stop.
More information:
- I'm using cygwin in Windows7
theProgram.exestops without finishing