I want to open the terminal (command prompt) on a Linux machine using Java code. I know how to open command prompt in windows.The following code i have used in windows
I think it would be nice if your application will open user's default terminal application.
Unfortunately, it seems that there is no universal way to determine it.
In my opinion the most preferrable solution would be (stop whenever you can open something):
Finding out user's desktop environment and it's default terminal might be too complicated for your purpose, so I'd use two last options. You can run application from $TERM with code like this:
String command = System.getenv().get("TERM");
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(command);