title: Mac open a new terminal and run a script with parameter in JAVA
body: <p>So I want to use ProcessBuilder in java to launch a script on a VM. That script launch an appium server and i want it to stay open even after the java program end. So i have something like this :</p>
  
  <pre><code>String[] command = {"/bin/sh", currentDirectory + "/Script/launchVM_Node/" + launchAppiumServer.sh, IPADRESS }; 
  
   ProcessBuilder   ps =new ProcessBuilder(command);
   ps.start();
  </code></pre>
  
  <p>launchAppiumServer.sh :</p>
  
  <pre><code>ssh username@$1 "source /etc/profile; appium serverArgs "
  </code></pre>
  
  <p>So This is working no problem, but as soon as the java program end, it close the server. So my workaround was to open a new terminal and launch the script there. Something like :</p>
  
  <pre><code>   String[] command = {"open -b com.apple.terminal", currentDirectory + "/Script/launchVM_Node/" + launchAppiumServer.sh, IPADRESS }; 
  </code></pre>
  
  <p>But it's not working. How can i open a new terminal, launch my script and pass parameter to it ? ( so at the end of my java program it won't close )</p>