eclipse debugging and standard input

Discussion in 'Java' started by jordilin, Jan 11, 2008.

  1. jordilin

    jordilin Guest

    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
     
    jordilin, Jan 11, 2008
    #1
    1. Advertising

  2. jordilin wrote:
    > 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.

    --
    Thomas
     
    Thomas Fritsch, Jan 11, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bvh
    Replies:
    0
    Views:
    363
  2. adrin

    eclipse and CDT debugging problem

    adrin, Feb 13, 2007, in forum: C Programming
    Replies:
    2
    Views:
    454
    Roberto Waltman
    Feb 13, 2007
  3. chewie54
    Replies:
    1
    Views:
    405
    Paul Rubin
    Nov 13, 2007
  4. nrolland
    Replies:
    0
    Views:
    136
    nrolland
    Oct 28, 2006
  5. Venks
    Replies:
    5
    Views:
    277
    Ken Bloom
    Dec 6, 2007
Loading...

Share This Page