0
点赞
收藏
分享

微信扫一扫

java怎么样判断一个进程是否已近结束

凉夜lrs 2023-04-12 阅读 68


以记事本程序为例
Process p = Runtime.getRuntime().exec("notepad.exe");

try {
    p.waitFor();//等待notepad.exe的结束
}
catch(InterruptedException ex) {
    System.err.println("ERROR");
    System.exit(1);
}

//继续自己的程序

参见http://zhidao.baidu.com/question/100219452.html

举报

相关推荐

0 条评论