[ https://issues.apache.org/jira/browse/EXEC-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16904192#comment-16904192 ]
Gary Gregory edited comment on EXEC-110 at 8/9/19 9:17 PM: ----------------------------------------------------------- [~wlei1818], Thank you for your report. May you please create a PR on GitHub at [https://github.com/apache/commons-exec] ? Thank you, Gary was (Author: garydgregory): [~wlei1818], Thank you for your report. May you please create a PR on GitHub at [https://github.com/apache/commons-exec] ? Thank you,Gary > Two issues in the tutorial of commons-exec > ------------------------------------------ > > Key: EXEC-110 > URL: https://issues.apache.org/jira/browse/EXEC-110 > Project: Commons Exec > Issue Type: Bug > Affects Versions: 1.3 > Reporter: Lei Wang > Priority: Major > > I found two obvious issues in the tutoral of commons-exec in the section of > "Unblock Your Execution". > with the provided sample code of "commandLine.setSubstitutionMap(map);", the > variable "commandLine" is different with "cmdLine" as abouve. > {code:java} > CommandLine cmdLine = new CommandLine("AcroRd32.exe"); > cmdLine.addArgument("/p"); > cmdLine.addArgument("/h"); > cmdLine.addArgument("${file}"); > HashMap map = new HashMap(); > map.put("file", new File("invoice.pdf")); > commandLine.setSubstitutionMap(map); > {code} > > the code "int exitValue = resultHandler.waitFor();" also has a mistake. > because with the api definition, the method of "waitFor()" have the "void" > return type, maybe you want to invoke "getExitValue()" which will return int > type. > {code:java} > int exitValue = resultHandler.waitFor(); > {code} > > attach the links for your refarance. > [http://commons.apache.org/proper/commons-exec/tutorial.html] > [http://commons.apache.org/proper/commons-exec/apidocs/index.html] -- This message was sent by Atlassian JIRA (v7.6.14#76016)