How do I make my jar file open a terminal window to run other class?
<p>I'm trying to make a Jar file which runs a main class that opens a new terminal window and run other class from inside that Jar.</p>

<p>I saw this discussion "<a href="https://stackoverflow.com/questions/7704405/how-do-i-make-my-java-application-open-a-console-terminal-window/">How do I make my java application open a console/terminal window?</a>" and Brandon Barajas' answer was exactly what I was looking for, but only for windows. I know how to make the system detection but I can't make the program do the same for mac and linux. Can somebody (maybe Brandon) help me? </p>

<p>EDIT:</p>

<p>I was able to make it work in linux using this command <code>Runtime.getRuntime().exec(new String[]{"/usr/bin/xterm","-e","java -Dfile.encoding=UTF8 -jar \"" + "/" + filename + "\""+"; bash"});</code>
to open xterm and issue the command, but I still don't know how to make it work for mac terminal.</p>

<p>EDIT 2:</p>

<p>Now I can open mac terminal using 
<code>Runtime.getRuntime().exec("/usr/bin/open -a Terminal /usr/bin/java");</code>
but it still won't accept arguments to run my program. It only opens terminal, run java and exit. If i try using
<code>Runtime.getRuntime().exec("/usr/bin/open -a Terminal /usr/bin/java -jar" + filename);</code>
it does nothing.</p>