LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 03: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, 11:51 AM   #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



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 10:13 PM
Updated Java... now java apps dont work zidane2010 Linux - Software 6 05-04-2004 08:02 PM
Terminal emulators don't work in X pherthyl Linux - Software 1 03-12-2004 12:58 AM
StarOffice7 Installation java terminal snash Linux - Software 2 02-06-2004 11:46 PM
Terminal windows in X don't work DJSpaceMouse Linux - Software 6 07-29-2003 01:16 PM

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

All times are GMT -5. The time now is 11:06 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