title: Unable to get R language system2 command result
body: <p>i am not able to get the system2 result. tried to execute the sample jar file.</p>
  
  <p><strong>execute_system.R:</strong></p>
  
  <pre><code>workingDir &lt;- "C:/Code"
  setwd(workingDir)
  command &lt;- "java -jar sample.jar 674"
  commandResult &lt;- system2(command, stdout="C:/Code/stdout.txt", stderr="C:/Code/stderr.txt")
  cat("commandResult: ", commandResult)
  </code></pre>
  
  <p>I am getting the error message when i execute this <strong>execute_system.R</strong> file and empty file is generated (stdout.txt, stderr.txt)</p>
  
  <pre><code>commandResult: 127
  warning message: running command '"java -jar sample.jar 674"' had status 127
  </code></pre>
  
  <p>I want to read the system2 command result and needs to be process the result data.</p>
  
  <p>When i execute the same command prompt, i am getting the proper result</p>
  
  <pre><code>C:/Code&gt;java -jar sample.jar 123
  convert from String to int...
  Input: 123
  Value: 123
  Conversion process done!!!
  </code></pre>
  
  <p>Actual my Java Code</p>
  
  <pre><code>public class Conversion{
     public static void main(String args[]){
        System.out.println("convert from String to int...");
        String input = args[0];
        System.out.println("Input: " + input );
        int value = Integer.valueOf(input)
        System.out.println("Value: " + value);
        System.out.println("Conversion process done!!!);
     }
  }
  </code></pre>
  
  <p>I converted this java program into executable jar file (sample.jar).</p>
  
  <p>Please help me.
  Thanks in advance.</p>