posted 13 years ago
As Rob says, you will block your output if you don't empty both streams, but it appears to be the output stream you are forgetting, and the error stream you are reading from.
By the way: reserve System.exit(0) for normal termination; use System.exit(i) where i is a non-zero int for abnormal termination, as you have in your catch block.