sketchup绘制球体插件sphere
关于Runtime.getRuntime().exec()产生阻塞的2个陷阱
秋刀鱼の滋味: [code=java] public void RunCmd(String cmdarray[], File file) { Thread t = new Thread(new Runnable() { public void run() { InputStream inputStream = null; InputStream errorStream = null; OutputStream outputStream = null; try { Process process = Runtime.getRuntime().exec(cmdarray); outputStream = process.getOutputStream(); outputStream.close(); //读取缓冲区返回得数据,不然会造成线程阻塞 inputStream = process.getInputStream(); errorStream = process.getErrorStream(); new ProcessClearStream(inputStream).start(); new ProcessClearStream(errorStream).start(); //阻塞方法, 导致当前线程等待. int exitVal = process.waitFor(); System.out.println(exitVal == 0 ? "执行成功" : "执行失败"); boolean delete = file.dele[/code]