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...
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?
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.
Joined: Dec 10, 2001
I knew there was a simpler way, I just couldn't remember it.
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.)