Get subprocess id in Java

前端 未结 5 904
悲&欢浪女
悲&欢浪女 2020-12-06 05:55

I\'m creating subprocesses in this way:

String command = new String(\"some_program\");

Process p = Runtime.getRuntime().exec(command);

How

5条回答
  •  隐瞒了意图╮
    2020-12-06 06:19

    I tried (and failed) to do this a while back. I ended up wrapping my command in a shell script that dumped the pid to a file. Not the best solution but it got me past this hurdle.

提交回复
热议问题