Originally posted by Gyan Prakash Srivastava:
now when I run the Java code, it is hanged! if I terminate this external process manually then java code execute rest of it. interestingly the same executable primegens.exe works fine while running from MS command Prompt.
From the few bits of info you provide my guess is that primegens.exe writes to System.out and/or System.err until the output buffer is full and then gets stuck. The Java program that does the exec does not drain the two streams, but just waits for the process to finish --- deadlock.
Before Java does not get proper process control features, something like my
http://www.ebi.ac.uk/~kirsch/monq-doc/monq/stuff/Exec.html may help.
[ October 14, 2005: Message edited by: Harald Kirsch ]