Discussion Locked

javac output redirection

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How does one redirect the output of the java compiler in DOS? When there are many error messages from javac, they fill up more than one screen.

I have tried redirection (>), stderr redirection(2>) which gives an error message and calling the compiler from a batch file.

I am looking for a way of either viewing the javac output one screen at a time or storing the output in a file. This is only an issue in DOS, in UNIX it works fine.

4 replies

by ricky.gomez

On Windows NT/Windows 2000:
javac myfile.java 2> errors.dat
works.

On Windows versions that are based on DOS (95/98/ME) you can not redirect stderr using the command.com shell.

You can try using another shell. I personally like Cygwin(GNU Bash).

On the Computing Concepts with Java Essentials FAQ http://www.horstmann.com/ccj2/faq.html they have a solution using the command.com shell.

Good Luck.

This discussion is closed to new replies.