This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes how to redirect the linux terminal contents to a textpane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to redirect the linux terminal contents to a textpane" Watch "how to redirect the linux terminal contents to a textpane" New topic
Author

how to redirect the linux terminal contents to a textpane

sonu thomas
Greenhorn

Joined: May 26, 2010
Posts: 1
hi.. I was trying to run a java class file using java code.The aim was to direct the executing sequence of the terminal of fedora 10 into a frame with a textpane.

My code is:


The content of jrun.sh is



When the content of nn.java was this:



It worked smoothly

But when I remove the comment on line--notable,it gave me Textpane with no content.

The problem is : I cant read an input from nn.java

Kindly give me a solution...

If i am able to: get the terminal pop up with executing the nn.class,and i am able to enter the input,the it will do...

Thanks in advance...
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10172
    
    8

Cross posted at http://stackoverflow.com/questions/2910685/how-to-redirect-terminal-contents-to-a-textpane

Sonu,
Please read http://faq.javaranch.com/java/BeForthrightWhenCrossPostingToOtherSites


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

You should really read When Runtime.exec() won't. You are reading from the process' input and error streams sequentially. If the error stream's buffer fills up while you're still reading from the input stream the process will block indefinitely.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
jQuery in Action, 2nd edition
 
subject: how to redirect the linux terminal contents to a textpane
 
Similar Threads
Is Java's alignment "Justify" is same as MS Word's alignment "Justify"?
Java Coding and UML Aggregation v/s Composition
regarding peer to peer network through java
Images
problem in iterating through files.