Trying to launch ant 1.6.1 I have an InstantiationException reported (see the stack trace below). java.lang.InstantiationException: org.apache.tools.ant.Main at java.lang.Class.newInstance0(Class.java:291) at java.lang.Class.newInstance(Class.java:259) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56) Simply back to an older release (Ant 1.5.4 for example), everything run fine. I'm sure it's a Java environment issue on my computer but I can't see it (JDK release, CLASSPATH definition, something else). Have you any information about that ? I'm using JDK 1.4.1.
I have faced this pb with Ant 1.6.1 as well Could workaround it by adding %ANT_HOME%\lib to my CLASSPATH environment variable
Which jar files do you add to your CLASSPATH? I'm encountering the same problem with the 1.6.1 build (I haven't tried compiling from source - yet). I'm using a Windows 2000 service pack 4 on a DELL Pentium 4 2.0GHz with 1G of RAM. ANT_HOME is set to C:\Programs\Ant\apache-ant-1.6.1 and JAVA_HOME is set to C:\J2sdk1.4.2. Additionally, my CLASSPATH includes %JAVA_HOME%\lib\tools.jar; Everything works fine with earlier builds on this machine. LAST NOTE: I also own a Mac G4 dual 1GHz processor running OSX 10.3.4 and have ant1.6.1 installed on this machine. This version of Ant runs without any problems on my Mac. Leading me to suspect that the problem is with the build.
The cause of this problem is normally an old ant.jar or weblogic.jar in the classpath. I have added an entry in the FAQ. One does *NOT* work around this by adding $ANT_HOME/lib to the classpath. Try unsetting the CLASSPATH and calling ant -version.