passer1991

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

以记事本程序为例
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

posted on 2012-12-11 11:19  passer1991  阅读(965)  评论(0编辑  收藏  举报

导航