Re: JavaProcessBuilder freeze to execute external
Posted By:
Pavel_Nemec
Posted On:
Monday, August 3, 2009 04:17 AM
Hm Read The Friendly Manual (RTFM)
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Process.html#waitFor()
causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. This method returns immediately if the subprocess has already terminated. If the subprocess has not yet terminated, the calling thread will be blocked until the subprocess exits.
Another way. wait for will really freez your application. You probably want to read std in ant stdout. You should do it in Thread (so it will not block you main app.
Hope it helps.