

A better solution is to accept command line arguments for the users preferred shell or to use a configuration file which the user can change to make your script open the shell of his/her choice.ġ.
#Linux open terminal install#
I suggest you catch an exception in case the terminal you chose isn't present and handle it by asking the user to install it. The command string can also be modified to use different shells like zsh. You might want to open another terminal emulator like rxvt, eterm, aterm, gnome-terminal or konsole. The basic assumption I have made is that you want to open xterm, which is available on almost any system (with X installed of course). Public static void main(String args) throws IOException To open a terminal window, you just have to modify your command string like this:- import java.io.* A terminal emulator provides an interface (window) for the shell and some other facilities for using the command prompt. Each shell is basically a command interpreter that understands Linux commands (GNU & Unix commands is more correct I suppose.).

In Linux, there are a number of terminal emulators which allow you to interact with various shells.
