首页 > 代码库 > java打开后台程序

java打开后台程序

try{

String cmds="java -version";

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

int exitValue = http://www.mamicode.com/1;

if((exitValue = http://www.mamicode.com/p.waitFor()) != 0)

{
p.destroy();

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

System.exit(exitValue);
}

}catch (IOException e) {

e.printStackTrace();

}catch (InterruptedException e) {

e.printStackTrace();

}