How can I unblock from a Java started process?

前端 未结 8 1052
旧巷少年郎
旧巷少年郎 2021-01-29 01:27

When executing some command(let\'s say \'x\') from cmd line, I get the following message: \"....Press any key to continue . . .\". So it waits for user input to unblock.

8条回答
  •  有刺的猬
    2021-01-29 01:54

    You should read the ouput and error streams of your subprocess simultaneously. The buffer size of these streams is limited. If one of the buffers gets full the subprocess will block. I think that is what happens in your case.

提交回复
热议问题