使用时,您应该明确关闭输入/输出流
Runtime.getRuntime().exec。
Process p = null;try { p = Runtime.getRuntime().exec("ls -l"); //process output here p.waitFor();} finally { if (p != null) { p.getOutputStream().close(); p.getInputStream().close(); p.getErrorStream().close(); }}


