PDA

View Full Version : [SOLVED] JAVA passing commands to terminal



Ra'anan
October 24th, 2011, 12:14 AM
Hi,
I'm using this simple code:


public static void main(String args[]) throws IOException
{

String command= "/usr/bin/gnome-terminal";
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(command);
}

I'm relatively new to JAVA programming but does anyone know how I can pass commands to the opened terminal?

Zugzwang
October 24th, 2011, 02:15 PM
I'm relatively new to JAVA programming but does anyone know how I can pass commands to the opened terminal?

Look at the man page of "gnome-terminal" - you can use the parameter "-x".