This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
A 'man' of gnome-terminal will show you one thing that is wrong; it indicates that you need to supply the command either with an "--execute" or "--command" argument BUT I suspect this will not solve your problem since I doubt that you just want a transient flash of a gnome terminal to appear. I'm betting that what you actually want to do is run a set of commands in a bash shell and collect the output in your Java program. In this case you need to do a man of 'bash' and then read the 4 sections of http://www.javaworld.com/jw-12-2000/jw-1229-traps.html and implement ALL the recommendations.
Note - you can supply the bash commands either as a command line argument to bash or though the bash stdin; the man page has the details. If you want to supply multiple commands to bash then it is usually best to write them to the bash stdin.
Joined: Jul 23, 2009
Thanks Richard, as you said i need to execute a set of commands and capture that output in a java program.