title: Java runtime issue from Swing application
body: <p>I have one swing application from which I am executing one jar file, which will do some processing internally. Process I have is as below:
  1. one java file with main() which loads swing GUI. From that GUI I can browse and load required jar files to execute.</p>
  
  <pre><code>public static void main(String[] args)
  {
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
          public void run() {
              MigrationProcessElementDialog.createAndShowGUI();
  
          }
      });
  
  }
  </code></pre>
  
  <ol start="2">
  <li>From swing application I am loading jar file as:</li>
  </ol>
  
  <p></p>
  
  <pre><code>Runtime rt = Runtime.getRuntime();   
  // replacePath is the path of the jar file to be loaded.
  Process proc = rt.exec("java -jar " + replacePath);   
  int exitVal = proc.waitFor();
  </code></pre>
  
  <ol start="3">
  <li><p>When I trigger execution, from Task Manager I am seeing, two javaw.exe (one for eclipse, one for SWING GUI) and one java.exe for program flow.
  But program flow continues few times (evident from log update) but stuck after certain time. </p></li>
  <li><p>As soon as, I kill my swing GUI javaw.exe; program flow starts and continues rest of the part promptly. So it seems to me that somehow javaw.exe is blocking java.exe execution. Is it at all possible? what's the resolution of it?</p></li>
  </ol>
  
  <p>If I execute, my process executable jar from command prompt using normal java -jar "path" command, program flow is not stuck, it's working as expected.</p>
  
  <p>Only facing the problem when I am executing from GUI or using Runtime. I used ProcessBuilder also; but faced same problem.</p>
  
  <p>If any one can please give me any clue it will be really helpful. Thanks!</p>