我启动一个构建脚本,大约需要2-3分钟,并将输出重定向到StyledText(文本字段)
问题是程序在执行1-2秒后冻结(没有响应)
ProcessBuilder builder = new ProcessBuilder(
"cmd.exe",
"/c",
"cd \"" + binDir + "\" && " + entityDeployerParam);
final Process pRef = builder.start();
parent.getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
Scanner sc = new Scanner(pRef.getInputStream());
while(sc.hasNext()){
console.append(sc.nextLine()+"\n");
}
}
});
知道我能做什么吗?