How to monitor external process ran by ProcessBuilder?

前端 未结 3 1750
眼角桃花
眼角桃花 2020-12-19 08:47

This should be rather simple, but I don\'t see anything helpful in JavaDocs.

What I need is to run some external process from my Java code and then be able to monito

3条回答
  •  悲&欢浪女
    2020-12-19 09:04

    Based on the question's specific code snippet I might be useful to add that since 1.8 the Process class has an isAlive() method is available

    Documentation link: https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html

    good luck to anyone reading this!

提交回复
热议问题