views:

346

answers:

1

I have a ant javac task which is supposed to run some annotation processor. It works fine when run from a batch file, but fails with

Error running javac.exe compiler

when started from eclipse. Normal compiling javac tasks work just fine.

I guess ant started from eclipse uses some different compiler?
How do I change it to the normal compiler? Or make it work in any way?

+2  A: 

It is usually because of a missing tool.jar

You are missing a tools.jar on the runtime classpath of Ant used in the Eclipse integration.
If you start Eclipse with a JDK install (using the -vm argument), tools.jar will be added automatically.
Otherwise, you can add it yourself using Window>Preferences>Ant>Runtime>Classpath. (see also this thread)

alt text

Note: a fork="true" can also be problematic.

VonC
setting fork to false did the trick for me. Thanx
Jens Schauder