Computing.Net > Forums > Programming > Export Java compilation errors into a file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Export Java compilation errors into a file

Reply to Message Icon

Name: MasterT
Date: November 9, 2009 at 10:50:23 Pacific
OS: Windows XP
CPU/Ram: ????
Subcategory: Java
Tags: javac.exe, compile, compilation errors
Comment:

Hello!

I'm making some program (not in java - in PHP if it matters but its really irrelevant).

I need to compile some java files with javac.exe (and later run them)

To compile it I first copy all necessary files into a folder called "temp" and then compile it.

Example batch code:

cd temp
D:\Programs\Java\bin\javac.exe  Tester.java > compile_log.txt
java Tester > log.txt

When the java code is correct the program creates a file named "compile_log.txt" which is empty, and a file called "log.txt" with all the output from the java program.
(Which is perfect).

Now, when there are java compilation errors, I've expected compile_log.txt to contain all the errors, but its still empty.

How can I output the compilation errors into a file using batch?



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: November 9, 2009 at 11:00:20 Pacific
Reply:

Have you tried

D:\Programs\Java\bin\javac.exe  Tester.java 2> compile_log.txt


0

Response Number 2
Name: MasterT
Date: November 9, 2009 at 11:12:48 Pacific
Reply:

Wow! Thank you for the quick (and correct!) reply!


It works like a charm!


But I would really like to know what the "2" stands for.

The second "section"? second "echo statement"?


Thanks again,
Daniel


0

Response Number 3
Name: Razor2.3
Date: November 9, 2009 at 11:27:05 Pacific
Reply:
0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Export Java compilation errors into a file

move a file from network in java? www.computing.net/answers/programming/move-a-file-from-network-in-java/4144.html

reading in a file in java www.computing.net/answers/programming/reading-in-a-file-in-java/7233.html

Pull Multiple Lines into Text File www.computing.net/answers/programming/pull-multiple-lines-into-text-file/19807.html