LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-18-2004, 04:20 AM   #1
nedian123
Member
 
Registered: Jun 2004
Location: PAKISTAN
Posts: 46

Rep: Reputation: 15
How to work in a new TERMINAL in JAVA


hi,
Actually i m trying to run a command thru java's Runtime class method exec, but that command requires another Terminal or command.exe
.................................................................................................... ..................................
Runtime t=Runtime.getRuntime();
InputStream is1 = t.exec("gnome-terminal").getInputStream();
InputStream is = t.exec("rsh 192.168.0.20").getInputStream();
.................................................................................................... .....................................

I want to execute the THIRD line in the new terminal opened by the second line of code. Because working in the same terminal doesn't work.

Kindly solve
Akhtar
 
Old 12-18-2004, 12:51 PM   #2
mhiggins
Member
 
Registered: Feb 2004
Posts: 140

Rep: Reputation: 15
My 1st question is , do you need to run the rsh command in a gnome terminal ? Could you just run the rsh command on its own in
java ? If you can't for some reason then your can try

t.exec("gnome-terminal -x rsh 192.168.0.20").getInputStream();

I also think you may be misunderstanding what happens when you call exec, here is a nice tutorial.

http://www.javaworld.com/javaworld/j...229-traps.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
JAVA:Problems in Displaying Data to Terminal.. nedian123 Programming 1 07-06-2004 11:13 PM
Updated Java... now java apps dont work zidane2010 Linux - Software 6 05-04-2004 09:02 PM
Terminal emulators don't work in X pherthyl Linux - Software 1 03-12-2004 01:58 AM
StarOffice7 Installation java terminal snash Linux - Software 2 02-07-2004 12:46 AM
Terminal windows in X don't work DJSpaceMouse Linux - Software 6 07-29-2003 02:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration