try {
//关闭进程
String command = "taskkill /f /im xx.exe";
Runtime.getRuntime().exec(command);
Thread.currentThread().sleep(2000);
//启动进程
String path = "E:\\xx\\xx\\xx.exe";
System.out.println(path);
Runtime.getRuntime().exec(path);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//关闭进程
String command = "taskkill /f /im xx.exe";
Runtime.getRuntime().exec(command);
Thread.currentThread().sleep(2000);
//启动进程
String path = "E:\\xx\\xx\\xx.exe";
System.out.println(path);
Runtime.getRuntime().exec(path);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}