File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Java in General
Bookmark "logging of compile time errors" Watch "logging of compile time errors" New topic

logging of compile time errors

Ankit V Agrawal

Joined: Nov 26, 2008
Posts: 15

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

Joined: Oct 13, 2005
Posts: 46408
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

Joined: Jul 08, 2003
Posts: 24199

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

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

Can any one please help me
Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

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.
I agree. Here's the link:
subject: logging of compile time errors
It's not a secret anymore!