Reputation: 133
When I run my Ant build in Eclipse, I'm getting the following error message and the Ant build fails.
Error Message: Error running javac.exe compiler
Line where the build stops:
<xmlbean schema="schemas"
destfile="build/lib/schemas.jar"
srcgendir="src"
classpathref="xmlbeans.path"
debug="on"
/>
Upvotes: 1
Views: 2113
Reputation: 1367
I had a similar problem with the same error message: "Error running javac.exe compiler". The log in the output console was pointing at line 17 in the build.xml file.
<javac includeantruntime="false" debug="on" fork="true" destdir="${build.dir}/classes" srcdir="${basedir}/src" classpathref="axis2.classpath">
</javac>
I followed Rahul Yadav's second answer which is:
Also one thing you can do in eclipse is RightClick on buid.xml>>Run As>>External Tools Configurations>>JRE tab>>Separate JRE radio button and select JDK from dropdown>>Run button
It might not be the right answer that the user who asked this question was looking for, but I faced a similar issue and it solved my problem. So, someone might find this answer useful.
Upvotes: 0
Reputation: 1513
Make sure your JAVA_HOME is pointing to jdk and not JRE. Also one thing you can do in eclipse is RightClick on buid.xml>>Run As>>External Tools Configurations>>JRE tab>>Separate JRE radio button and select JDK from dropdown>>Run button
Upvotes: 1