I am writing a platform independent Java console tool and within which will have to execute some commands in separate independent terminal at runtime.However, I need to know which terminal should I be using gnome-terminal or xterm. i.e. the one available on that particular system.Since there are many different linux variants are available. I want to support at least the most obvious ones.Normally in Java System.getProperty(os.name) returns Linux but it doesn't tell you if its Ubuntu or any other Linux varient. So It is difficult to know which terminal to start at runtime. Whether gnome-terminal or xterm or if there is anything else as well that I don't know.Working sets:In Windows:cmd /c start java -jar jarTool argumentsIn Ubuntu:gnome-terminal --execute java -jar jarTool argumentsorxterm -e java -jar jarTool argumentsAlso just for additional information,I am using Runtime.getRuntime().exec(args or commands) to start terminal from Java program at runtime.
Choose a terminal emulator from Java
java;terminal emulator