To Redirect Error Messages from Command Prompt
February 12, 2010
When redirecting output from an application using the “>” symbol, error messages still print to the screen. This is because error messages are often sent to the Standard Error stream instead of the Standard Out stream. To redirect STDERR specify “2>” by which the error messages are redirected to the specified channel
eg : javac SampleFile.java 2> compileerror.txt
The compilation errors are captured in the compileerror.txt file.
Advertisement
No comments yet