This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I route the compiler output?  RSS feed

 
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
Posts: 21088
85
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
Boost this thread!