Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BuildException when executing Ant task

Tags:

apache

ant

I have installed Apache Ant and set the correctly the Path, CLASS_PATH and ANT_PATH variables. When I run a jar task in a command line within my project folder where the build.xml file is, I get the following error:

BUILD FAILED

C:\Documents and Settings\TonyS\My Documents\My Workspace\code\build.xml: 32:

The following error occurred while executing this line:
jar:file:/C:/Documents%20and%20Settings/TonyS/My%20Documents/Ant/apache-ant-1.8.1/lib/ant.jar!org/apache/tools/ant/antlib.xml:37: Could not create task or type: componentdef.

Ant could not find the task or a class this task relies upon.
like image 507
Anto Avatar asked Oct 11 '10 15:10

Anto


2 Answers

I had this error and found it was caused by having an older version of ant.jar in the classpath.

like image 108
Peter Jamieson Avatar answered Oct 03 '22 19:10

Peter Jamieson


One possibility is you may have another version of ant installed on your system and your PATH pointing to it.

Check what is ANT_HOME set to.

Run ant -version and see if it shows up 1.8.1

like image 44
Raghuram Avatar answered Oct 03 '22 19:10

Raghuram