• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I route the compiler output?

 
Christopher Young
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well first of all, I'm running Windows XP.

Ok, I'm using the java compiler from the command line and was wondering if there was a way i could save the error messages it generates to a file.

echo javac folder/file.java > errorList.txt only produces the line I typed in, although I know that file.java has a bunch of errors.

Is there a way I can actually get the data the compiler generates into a text file? I mean an IDE is somehow able to pull the messages it generates to put somewheree. I just think it'd be useful for (among other things) going back and fixing my code without having to switch back and forth between the console (Since I'm using TextPad)
 
Christopher Young
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nm.

Someone on another board told me to just write javac file.java 2> output.txt

and that works fine.

So problem solved.
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another hint that will allow you to redirect both standard output and error output to the same file:

The 2>&1 is for redirecting the error output (2) to the standard output (1; the & is for the address).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic