For examples, this is my bash script
osascript -e 'tell app "Terminal"
do script "./process1"
end tell'
osascript -e 'tell app "Terminal"
do script "./process2"
end tell'
Basically, it will open two different terminal windows (on mac) and execute defined commands. I try to do this in java by
process1 = Runtime.getRuntime().exec(new String[]{"process1"});
process2 = Runtime.getRuntime().exec(new String[]{"process2"});
The problem is it seems that there is only one terminal is opened (and not visible - it runs in background) and then two command process1 and process2 are executed. But because the process 1 will keep that terminal busy thus process2 cannot run. That's why I want to open different terminal to execute those commands.