Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading compiler errors

 
John Ringo
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've got Java on a Windows box. I compile from the MSDOS prompt, but when I get 20 errors it scrolls to fast and I can't see the ones at the top. I know there has to be a better way to deal with this, so I'd appreciate any advice that anyone can share. Thanks...
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!
And you must be very intelligent as your display name complies with The JavaRanch Naming Policy! (If that is your real name...)
A very nice thing here at JavaRanch is the ability to search past conversations for lots of very useful information. The search page link is at the top right of this page.
Taking a look at this past conversation, we discover that System.out can be redirected. And, thinking that "well, if it can be done with System.out, there well may be something similar with System.err which is the print stream used to output the error messages," it then seems like a good idea to check out the API documentation for the System class where we discover System.setErr(PrintStream)!
Making sense?
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Johnny
Yoou can also redirect the output from the command prompt directly to a text file:
javac JavaFile.java 2>compilerErrors.txt
Now all of the compiler errors will go to the file named 'compilerErrors.txt'. the '2>' represents the error redirection while just a plain '>' will redirect normal output.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I knew there was a simpler way, I just couldn't remember it.
 
John Ringo
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
John Dale
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Redirecting output is great, there is something you might like better for this.
In Windows NT & 2000, you can tell your command prompt window to use a large screen buffer, complete with scroll bar. Not sure about 95/98/ME.
Click on the system logo in the title bar (typically an MS-DOS logo). Then select Propreties - Layout. Having plenty of memory, I usually set the screen buffer to about 1000 lines.
(I'd keep it smaller on an 95/98/ME system, if this feature is supported there.)
 
John Ringo
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks John. The more ways the better.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic