java: Runtime和Process调用本机程序

时间:2022-01-07 21:56:15

java: Runtime和Process调用本机程序

调用纸牌程序,Process用来销毁程序

import java.io.IOException;

public class RunTimeDemo {

	public static void main(String args[]) throws Exception
{ Runtime rt = Runtime.getRuntime();
Process pro = rt.exec("freecell.exe");
Thread.sleep(2000);
pro.destroy();
} }

  

相关文章