欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

在java中启动其他程序。  

程序员文章站 2022-03-21 18:06:43
...
	public static void main(String args[]){
		System.out.println("Hello World!");
		Runtime r=Runtime.getRuntime(); 
		Process p=null; 
		try 
		{ 
		p=r.exec("notepad"); 
		} 
		catch(Exception ex) 
		{ 
		System.out.println("----------------"+new java.util.Date());
		ex.printStackTrace();
		} 
	}