> Use Runtime.getRuntime().exec() for sure, and pay
> close attention to the
> Process.get[Input|Output|Error]Stream methods:
> http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Proc
> ess.html
And also note that the terminals won't be opened in any AWT or Swing components.....
> For example, is there a way that the new shell brought up
> by xterm can be stored in my program as a variable
> and then how can I access it later to give that shell
> another command? Thanks.
Instead of running 'xterm' via Runtime.exec(), just run a 'bash'/'cmd' shell. Use the Process.get[Input|Output|Error]Stream methods to pass data and get text returned from the command shell.
I'm sorry if I am coming off like an idiot or something but I just cannot figure out how to do this. I use the line:
Runtime.getRuntime().exec("bash");
I know this does something because no errors are given but I just do not know what it does. Is this supposed to open a new shell? Is there anywhere that I can look for code examples on this or could you give me a short one? Thanks.
> I'm sorry if I am coming off like an idiot or
> something but I just cannot figure out how to do
> this. I use the line:
>
>Runtime.getRuntime().exec("bash");
> now this does something because no errors are given
> but I just do not know what it does. Is this supposed
> to open a new shell? Is there anywhere that I can
> look for code examples on this or could you give me a
> short one? Thanks.
Are you trying to embed an xterm inside a Swing component?