Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Debugging while using redirected input.

Reply
Thread Tools

Debugging while using redirected input.

 
 
andrew.butt@gmail.com
Guest
Posts: n/a
 
      02-28-2006
Hello, I am a new Java programmer and am trying to debug a simple
program which uses redirected input from a text file, I usually launch
it from a linux prompt using... java sample.java < text.txt ... The
problem I am having is that the only debugger am I familiar with is
Eclipse's own, and I cannot seem to figure out how to redirect input in
the same way.

If anyone could tell me how to acomplish this, or recommend another
program and explain how to with that one I would be greatly in your
debt.

Thanks in advance.

 
Reply With Quote
 
 
 
 
Alex
Guest
Posts: n/a
 
      02-28-2006
This is java. And even, for unknown reason, you want to work only with
System.in you can always change it.

So, for dubigging purpose, add one line in the beginning of your main
method:
System.setIn(new FileInputStream("text.txt"));
and it will read this particular file instead of System.in.

Alex.

 
Reply With Quote
 
 
 
 
andrew.butt@gmail.com
Guest
Posts: n/a
 
      02-28-2006
Thanks alot, exactly what I needed

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Form based Authenication and still getting redirected back to the login page Irishmaninusa ASP .Net Security 0 09-23-2004 03:02 PM
You are about to be redirected to a connection that is not secure Steve Harris ASP .Net 6 09-23-2004 09:36 AM
Redirected folders Slammer MCSE 12 12-02-2003 10:31 PM
redirect using location header does not work from an already redirected doc. Will Perl Misc 5 12-02-2003 11:01 AM
Got error msg while Debugging : Error while trying to run project: ... ^CrazyCoder^ ASP .Net 3 09-15-2003 09:40 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57