我在一个单独的命令行控制台中通过exce()函数运行了一个外部工具。
command = "cmd.exe /c start /min doxygen " + strDoxyfilePath;
System.out.println("command : " + command);
//pass the command to execute
Process p=Runtime.getRuntime().exec(command);我将其用于读取输入流:
BufferedReader br = new BufferedReader(new InputStreamReader
(p.getInputStream(), "UTF-8")); //read output of doxygen
String line = null;
while ((line = br.readLine()) != null){
System.out.println("I M HERE: "+line);
}但是控制没有进入while循环,我想在进程结束时得到适当的信号。
发布于 2011-10-28 15:36:03
我认为经典的When Runtime.exec() won't仍然最好地解释了这一点。
https://stackoverflow.com/questions/7925233
复制相似问题