In order to redirect the java standard output to a file, we need to use the greater-than-sign (>) character followed by a filename after java.exe on a command line.
For example:
java Hello > D:\output.txt
This will redirect the output of System.out.println() to output.txt file
Sunday, August 10, 2008
Java: Redirect Java Output to a File
Subscribe to:
Post Comments (Atom)
Since 26 July 2008:
No comments:
Post a Comment