java打开后台程序

来源:互联网 发布:软件推广平台 编辑:程序博客网 时间:2024/05/22 00:55

try{

String cmds="java -version";

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

int exitValue = 1;

if((exitValue = p.waitFor()) != 0)

{
p.destroy();

System.out.println("exitValue:"+exitValue);

System.exit(exitValue);
}

}catch (IOException e) {

e.printStackTrace();

}catch (InterruptedException e) {

e.printStackTrace();

}

0 0
原创粉丝点击