title: ProcessBuilder and Process.waitFor(), how long does it wait?
body: <p>I am executing an .exe-file from java, using the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ProcessBuilder.html" rel="noreferrer">ProcessBuilder</a> class and the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html" rel="noreferrer">Process</a> class. To explain what I am doing:</p>
  
  <pre><code> builder = new ProcessBuilder(commands);
   builder.redirectErrorStream(true);
   Process process = builder.start();
   process.waitFor();
  </code></pre>
  
  <p>I just wanted to know, for how long is "waitFor()" waiting? Is it waiting until my .exe is executed, or is it waiting till its execution is finished?</p>
  
  <p>My .exe is a compiled AutoIt-script. That means, that there could be interactions like mouse movements, which take some time. 
  So I need to know if my Java-code execution goes on after calling the .exe or if it is really waiting for it. </p>
  
  <p>What I want to achieve is the rotational execution of two scripts, but I'm afraid, that my Java code is executing the second script while the first one is still running.
  Has anyone a workaround for this? I am glad for any ideas.</p>