Issue
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?
Solution
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 usingWindow>Preferences>Ant>Runtime>Classpath
. (see also this thread)
Note: a fork="true"
can also be problematic.
Answered By - VonC