Skip to content

To Redirect Error Messages from Command Prompt

February 12, 2010
tags: ,

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.

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: