开发者

Java: Starting a cmd process that won't execute his job, but loaded into memory

开发者 https://www.devze.com 2023-01-21 20:34 出处:网络
My problem is: I want to start a process via a thread and that process should execute his job. As far as I started the process, he remains into memory and does nothing until I close my main program.

My problem is: I want to start a process via a thread and that process should execute his job. As far as I started the process, he remains into memory and does nothing until I close my main program. (like it was some kind of suspended) And o开发者_JAVA百科nly after exiting main program, this process is starting to do what he must.

Did someone met that before?


The process is likely either waiting for input, or has filled its output buffer and needs you to empty it before it can continue. Take a look at Process.getInputStream(), Process.getOutputStream(), and Process.getErrorStream() for communicating with the process.

As a first step, you could try closing Process.getOutputStream() so it will stop waiting for you to provide input.

0

精彩评论

暂无评论...
验证码 换一张
取 消