title: java ProcessBuilder doesn't work
body: <p>I'm trying to execute batch file in java.</p>
  
  <p>My source is below:</p>
  
  <pre><code>List&lt;String&gt; comm = new ArrayList&lt;String&gt;();
  comm.add("cmd");
  comm.add("c:/Users/cointreau/workspace/pmd-bin-5.3.2/pmd-bin-5.3.2/bin/pmd.bat");
  comm.add("-d");
  comm.add("C:\\Users\\cointreau\\workspace\\counter\\src\\Counter.java");
  comm.add("-f");
  comm.add("xml");
  comm.add("-R");
  comm.add("java-codesize");
  comm.add("-r");
  comm.add("C:\\Users\\cointreau\\workspace\\counter\\report.xml");
  
  ProcessBuilder probuilder = new ProcessBuilder( comm );
  Process process = probuilder.start();
  
  //Read out dir output
  InputStream is = process.getInputStream();
  
  InputStreamReader isr = new InputStreamReader(is);
  BufferedReader br = new BufferedReader(isr);
  String line;
  
  while ((line = br.readLine()) != null) {
       System.out.println(line);
  }
  
  //Wait to get exit value
  try {
       int exitValue = process.waitFor();
       System.out.println("\n\nExit Value is " + exitValue);
       } catch (InterruptedException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
  }
  </code></pre>
  
  <p>the original command line is this, </p>
  
  <pre><code>c:/Users/cointreau/workspace/pmd-bin-5.3.2/pmd-bin-5.3.2/bin/pmd.bat -d C:\\Users\\cointreau\\workspace\\counter\\src\\Counter.java -f xml -R java-codesize -r C:\\Users\\cointreau\\workspace\\counter\\report.xml`
  </code></pre>
  
  <p><code>pmd.bat</code> is the batch file what i want to execute and the remainders are just parameters for the bat file.</p>
  
  <p>The only output I can see is just <code>exit Value is 1</code>.</p>
  
  <p>When I execute this command line in cmd, it runs properly but not in my java source.</p>
  
  <p>What should I do? </p>
  
  <p>Thanks for your help in advance.</p>