範例
protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1) throws IOException {
Process process = Runtime.getRuntime().exec("dir /s");
try {
int exit = process.waitFor();
}
catch (InterruptedException exc) {
// ...
}
}
解決方案
如果需要並行性,請使用聯合排存的執行緒來代替程序。