This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes logging of compile time errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "logging of compile time errors" Watch "logging of compile time errors" New topic
Author

logging of compile time errors

Ankit V Agrawal
Greenhorn

Joined: Nov 26, 2008
Posts: 15
Hi,

I want to log the compile time errors in a log file, preferably an .xls file instead of a .log file. Can any one please help me how to get arround this problem??


SCJP 5.o, SCWCD 5.o
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
Find the classic Daconta article entitled "when Runtime.exec() won't" and read that. It has an example with calling the Java Compiler.
Divert the error and output streams into your files.

Try that, it might work; I haven't tried myself.

Don't know how to get the errors into .xls format, but it should be easy to get them into comma separated value (.csv) format.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Rather than compiling by running javac directly, use Ant to create a build script; then use Ant's reporting capabilities to put the results in whatever format you need.


[Jess in Action][AskingGoodQuestions]
Ankit V Agrawal
Greenhorn

Joined: Nov 26, 2008
Posts: 15
What I want :
src\HelloWorld.java 6 ';' expected
in an xls file with
first cell : src\HelloWorld.java
second cell : 6
third cell ';' expected

Can any one please help me
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Why do you need it in an XLS file? Have you tried Ant and its reporting capabilities?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
Consider Paul's rocket mass heater.
 
subject: logging of compile time errors