java里怎么样杀掉一个进程?

		process.destroy();  // 发出杀出指令
		
		process.waitFor();  //等待,直到它断气。如果在此之前该进程已被他人终止,此方法也不会报错
	
		
		//如果不放心,可以再验一下
		try{		
    		     process.exitValue();
		}catch(IllegalThreadStateException e){
			
		     p("进程尚未退出!");
			
		}

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.