Possible Duplicate:
Open a new prompt/terminal window from Java
Is it possible to open a terminal window and execute certain command from a java window?
I tried
Runtime.getRuntime().exec("<command to execute>");
But it didn’t work. No terminal window was ever opened.
(On Windows, Mac, etc…I need solutions for multiple operating systems)
You need a solution for each OS:
Runtime.getRuntime.exec("/usr/bin/open -a Terminal /path/to/the/executable");Runtime.getRuntime.exec("/usr/bin/xterm");Windows (not sure ) :
Process p = Runtime.getRuntime().exec(“cmd /c start cmd.exe”);
p.waitFor();