示例
protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1) throws IOException {
Process process = Runtime.getRuntime().exec("dir /s");
try {
int exit = process.waitFor();
}
catch (InterruptedException exc) {
// ...
}
}
解决方案
如果需要并行性,那么使用合用线程而不使用进程。