File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes reading compiler errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "reading compiler errors" Watch "reading compiler errors" New topic
Author

reading compiler errors

John Ringo
Greenhorn

Joined: Feb 22, 2002
Posts: 17
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

Joined: Dec 10, 2001
Posts: 7023
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?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
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.


Dave
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
I knew there was a simpler way, I just couldn't remember it.
John Ringo
Greenhorn

Joined: Feb 22, 2002
Posts: 17
thanks
John Dale
Ranch Hand

Joined: Feb 22, 2001
Posts: 399
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

Joined: Feb 22, 2002
Posts: 17
Thanks John. The more ways the better.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reading compiler errors