Java Runtime.exec()

You need to drain the output and error streams of the process, or else it will block when the executed program produces output.

From the Process documentation:

Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock.

Leave a Comment