Monday, 14 May 2012

Problem: failed to create task or type antlib:org.apache.ivy.ant:retrieve

I've just installed NetBeans 7.1.2. When attempting to run an Ivy project I get the following error:

/home/rsharp/projects/project_name/ant-ivy.xml:5: Problem: failed to create task or type antlib:org.apache.ivy.ant:retrieve
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet
This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
        -ANT_HOME/lib
        -the IDE Ant configuration dialogs
BUILD FAILED (total time: 0 seconds)

This was because the default location for Ant in NetBeans is:

/usr/local/netbeans-7.1.2/java/ant

Whereas Ant is actually installed at:

/usr/local/ant

To set this, go to Tools > Options > Miscellaneous > Ant and modify Ant Home.

1 comment: