wood burning stoves 2.0*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 10268
    
    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: 19684
    
  20

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to redirect the linux terminal contents to a textpane