Apache Commons Exec

fmms 12年前發布 | 25K 次閱讀 Java 常用工具包

Apache Commons Exec 是 Apache 上的一個 Java 項目,提供一些常用的方法用來執行外部進程,如下面代碼所示:

String line = "AcroRd32.exe /p /h " + file.getAbsolutePath();
CommandLine commandLine = CommandLine.parse(line);
DefaultExecutor executor = new DefaultExecutor();
executor.setExitValue(1);
ExecuteWatchdog watchdog = new ExecuteWatchdog(60000);
executor.setWatchdog(watchdog);
int exitValue = executor.execute(commandLine);

項目主頁:http://www.baiduhome.net/lib/view/home/1326806394343

 本文由用戶 fmms 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!