Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Netbeans Ant Error

 
Jon Parise
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic