title: Running jar.exe, process.waitFor never return
body: <p>I have java cde that jars class files together:</p>
  
  <pre><code>    List&lt;String&gt; args = new ArrayList&lt;String&gt;();
      String path = FileSystemUtils.JavaBin() + "\\jar.exe";
      args.add(path);
      args.add("-cfv");
      args.add(jarName);
      args.addAll(FileSystemUtils.getAllFiles(directory, ".class"));
      ProcessBuilder pb = new ProcessBuilder(args);
      File wd = new File(directory);
      pb.directory(wd);
      Process p = pb.start();
      //Waiting for process to exit
      p.waitFor();
      int res = p.exitValue();
  </code></pre>
  
  <p>Tis code works great. 
  However, on some computers - not on all of them, when there are 7+ files, the <code>p.waitFor();</code> never return, even though the jar was created. </p>
  
  <p>Looking at the task manager, jar.exe really did not terminate.... what can be the cause?
  running the same command manually from the command line exits immediately.</p>
  
  <p>This seems very weird. Does someone have any hint?</p>