java.lang.InstantiationException: org.apache.tools.ant.Main
March 20th, 2009
Applies to:
Ant 1.6.x
Description:
Occurs while using Apache Ant.
Cause:
You have installed Ant 1.6.x and now get java.lang.InstantiationException: org.apache.tools.ant.Main. The cause of this is that there is an old version of ant somewhere in the class path or configuration.
A version of this problem may be seen on some linux systems. Some linux systems (Fedora Core 2 for example), comes with a version of ant pre-installed. There is a configuration file called /etc/ant.conf which if present, the ant shell script will ‘dot’ include. On Fedora Core 2, the /etc/ant.conf file resets the ANT_HOME environment variable to /usr/share/ant. This causes the problem that an old version of ant (1.5.x in this cause) will be used with a new version of the ant script file.
One can check if this is the case by doing ant –noconfig -version.