Posted By:
Anonymous
Posted On:
Sunday, March 10, 2002 09:48 PM
I wish to invoke an external .exe file from my java code. On the course of my code JVM should wait until the application is terminating and then i need to output the result of the application in the next line. My code is
try {
Process p = Runtime.getRuntime().exec("someApp.exe");
p.waitFor();
// getting the result string from log file.
System.out.println(result);
}
catch(Exception e) {}
but JVM not seems to be waiting for the application to terminate. It terminates soon after invoking the exe file. can anyone answer my question.
thanx in advance.