现在的位置: 首页 > 综合 > 正文

java打开后台程序

2014年09月05日 ⁄ 综合 ⁄ 共 288字 ⁄ 字号 评论关闭

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();

}

抱歉!评论已关闭.