aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Netbeans Ant Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Netbeans Ant Error" Watch "Netbeans Ant Error" New topic
Author

Netbeans Ant Error

Jon Parise
Ranch Hand

Joined: Jul 03, 2007
Posts: 81
Hey everyone,

I have a Java SE 6 project I built using Netbeans 6.1. Today Netbeans told me it had some updates, so I installed them. One of them was for Ant.

Now when I try to build my project I get the following:
ERROR - Ant is misconfigured and cannot be run.
java.lang.ClassNotFoundException: org.apache.tools.ant.input.InputHandler
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.apache.tools.ant.module.bridge.AuxClassLoader.findClass(AuxClassLoader.java:85)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.tools.ant.module.bridge.AntBridge.createAntInstance(AntBridge.java:283)
at org.apache.tools.ant.module.bridge.AntBridge.getAntInstance(AntBridge.java:264)
at org.apache.tools.ant.module.bridge.AntBridge.getInterface(AntBridge.java:253)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:460)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)


I'm not sure what the issue is, does anyone have any suggestions?

Thanks.
Damien Bertot
Greenhorn

Joined: Sep 19, 2008
Posts: 1
Hey Jon,

The same problem happened to me. I tried to uninstall and reinstall Ant (in Tools/Plugins/Installed) to no avail.
What worked for me was doing a search for "ant.jar" on my Netbeans 6.1 install folder ... which returned: "C:\Program Files\NetBeans 6.1\java2\update\backup\netbeans\ant\lib" - note that it's the backup folder from the update that screwed everything up - Then you go to "Tools/Options/Miscellaneous" and look if the "Ant Home" field is empty - it was for me - if it is empty, you'll have to add the path you found in your above search, minus the "lib" folder ... hence, in my case I copied the following path:"C:\Program Files\NetBeans 6.1\java2\update\backup\netbeans\ant", and IT WORKED ;o)
Good luck,
Damien.
Jon Parise
Ranch Hand

Joined: Jul 03, 2007
Posts: 81
I ended up just uninstalling and reinstalling all of Netbeans...

I will think twice before clicking the update button again. Thanks for the info.

Everything is working again for now.
Chaitanya Boyapati
Greenhorn

Joined: Nov 10, 2008
Posts: 1
Originally posted by Damien Bertot:
Hey Jon,

The same problem happened to me. I tried to uninstall and reinstall Ant (in Tools/Plugins/Installed) to no avail.
What worked for me was doing a search for "ant.jar" on my Netbeans 6.1 install folder ... which returned: "C:\Program Files\NetBeans 6.1\java2\update\backup\netbeans\ant\lib" - note that it's the backup folder from the update that screwed everything up - Then you go to "Tools/Options/Miscellaneous" and look if the "Ant Home" field is empty - it was for me - if it is empty, you'll have to add the path you found in your above search, minus the "lib" folder ... hence, in my case I copied the following path:"C:\Program Files\NetBeans 6.1\java2\update\backup\netbeans\ant", and IT WORKED ;o)
Good luck,
Damien.


Thank you Damien. This worked for me also.
[ November 10, 2008: Message edited by: Chaitanya Boyapati ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Netbeans Ant Error
 
Similar Threads
Client
EJB module unit test initialization error
Ant + Weblogic + EJb on Eclipse - UnsupportedClassVersionError
Weblogic platform8.1 SP4 installation error
Why doesn't the JUnit test OUTPUT appear using the Ant build?