eclipse debugging and standard input

J

jordilin

My program is a parser that accepts standard input and should be
executed like:
cat file.txt | javaprogram
I want to debug it, but I do not know how to put stuff into my program
(standard input) from Eclipse. In the open debug dialog, the common
tab, there is a section that says Standard input and output, but I
have no idea how it works.
Any idea or link on how can I introduce stuff into the standard input
of my program in the Eclipse debugging section. Hope I have explained
myself correctly.
Thanks
 
T

Thomas Fritsch

jordilin said:
My program is a parser that accepts standard input and should be
executed like:
cat file.txt | javaprogram
I want to debug it, but I do not know how to put stuff into my program
(standard input) from Eclipse. In the open debug dialog, the common
tab, there is a section that says Standard input and output, but I
have no idea how it works.
Any idea or link on how can I introduce stuff into the standard input
of my program in the Eclipse debugging section. Hope I have explained
myself correctly.
Thanks

In your Eclipse you should have a "Console" tab at the bottom.
(If not, you can make it visible by selecting "Window - Show View -
Console" from the menu bar)

Start your Java application with the Run/Debug dialog, without
standard-input-redirection ("cat file.txt |").
In order to provide data to standard input, just select the "Console"
tab (so that it gets the focus) and type in.
You can also use copy&paste (right click onto the Console to get a
context menu with a "Paste" item).
The "Console" will display standard input/output/error in green/black/red.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top