title: ProcessBuilder or Runtime.getRuntime().exec won't complete jar execution
body: <p>I have a jar which converts one XML to other XML format using XSLT in Java. The jar copies the output to some folder. It is working absolutely fine when am running it on command prompt but running it via <code>Runtime.getRuntime().exec or ProcessBuilder</code>, doesn't complete the process. Just 25 files are converted and it freezes. When i shutdown the process i can see all the files being loaded in the output folder which were not being loaded into the same folder.</p>
  
  <p>Any suggestions? </p>
  
  <p>My Code</p>
  
  <pre><code> private boolean runLoaderScript() throws IOException, InterruptedException {
      String args[] = { "java", "-jar", "C:\\Users\\gursahibsahni\\Desktop\\jar\\epnlm_new-1.0.0-jar-with-dependencies_WSJ_stringdate.jar", "-c", "-f", "-d", "7", "C:\\Users\\gursahibsahni\\Desktop\\ConsynInput\\wsjInput\\input" };
      ProcessBuilder builder = new ProcessBuilder(args);
      Process qq = (builder).start();
      qq.waitFor();
      return true;
  }
  
  private boolean runValidator() throws IOException, InterruptedException {
      Process validatorProcess = Runtime.getRuntime().exec("java -jar C:\\Users\\gursahibsahni\\Desktop\\jar\\wsj_jar_20140423.jar  -efv -d 7 C:\\Users\\gursahibsahni\\Desktop\\ConsynInput\\wsjInput\\output");
      return (validatorProcess.waitFor()) == 0 ? true : false;
  }
  </code></pre>
  
  <p>Additionally, when am trying to import the jar in my project and call the main function to convert the XML, it is not converting the XML properly.
  Meaning, the constants are coming up very nicely but the functions which are being called into class files to get data are not being called up during the import.</p>
  
  <p>YES! Running the jar on command line is a success! It works flawlessly. But when imported it is not converting properly. Why such behavior ? Its very <strong>strange</strong>. Please help.</p>