I want to open a new terminal window and execute my program in java code. So I use:
Runtime.getRuntime().exec("gnome-terminal -x /path/to/my/program arg1 arg2");
This is work fine in Ubuntu but unfortunately it is not work in CentOS, the problem is that the terminal window closed immediately.
I have search many time in stackoverflow but could not find out a solution. Thank you very much!!!