奇怪之处在于
1:dir windows目录应该是很长的一串,但是显示的只有一部分。
2:如果使用process.waitfor(),程序会停下来,而不是等待process的结束
我想跟踪显示process的输出,目前只想到开两个线程的方法,有没有更简便的方法
谢谢大侠
1:dir windows目录应该是很长的一串,但是显示的只有一部分。
2:如果使用process.waitfor(),程序会停下来,而不是等待process的结束
我想跟踪显示process的输出,目前只想到开两个线程的方法,有没有更简便的方法
谢谢大侠
import java.io.*;class testRuntime
{
public static void main(String[] args)
{
Process proc = null;
try{
proc = Runtime.getRuntime().exec("c:\\winnt\\system32\\notepad.exe");
proc.waitFor();
System.out.println("bbbb");
}catch(Exception e){
e.printStackTrace(System.out);
}
}
}