0
votes

When I run my ant task I get the following error

/build.xml:61: Problem: failed to create task or type javac Cause: the class org.apache.tools.ant.taskdefs.Javac was not found. Action: Check that the component has been correctly declared and that the implementing JAR is in one of: -/idea-IC-107.587/lib/ant/lib -/home/.ant/lib -a directory added on the command line with the -lib argument

But I have the ant.jar(which contains the Javac class) in the above mentioned path. Can anyone tell me what is the cause for this issue.

1
The problem came when I added the following jars to my project. jaxb-impl-2.2.5.redhat-8.jar, jaxb-xjc-2.2.5.redhat-8.jar, jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar, codemodel-2.6-redhat-2.jar, istack-commons-tools-2.6.1-redhat-2.jarAldrin Rodrigues

1 Answers

1
votes

All your ant stuff will work fine except the javac task which needs the tools.jar, located in the /lib directory of JDK, JRE is not sufficient.
So you need to use a JDK instead of JRE to make the javac ant task work.
Also see the ant output, when JRE is used ant prints a warning to stdout :

"Unable to find a javac compiler;..."