java.lang.Process.waitFor() not working, or how to use
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

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.

Re: java.lang.Process.waitFor() not working, or how to use

Posted By:   Sean_Ruff  
Posted On:   Monday, March 11, 2002 06:06 AM

try the following article




http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
About | Sitemap | Contact