Monday, August 25, 2008

Strange Ant/Eclipse (Ganymede) error

This had me going for a long time trying to figure out what the heck was going on. Any time I tried to run an ant task from inside eclipse I would get this "waiting for virtual machine to exit" message and ant would just hang. Nothing in the console at all to tell me what was wrong.

If I ran the same thing from the command line, everything worked fine, so it must be some eclipse setup thing that's screwed up.

To make a long story short, for some reason, the ant home directory was not pointing to the ant install in eclipse.

To fix, go to window | preferences | Ant | runtime | Ant Home... and enter the path to the embedded ant install (for me, this is: C:/Program Files/eclipse/plugins/org.apache.ant_1.7.0.vblahblah

For some reason, it was pointing into my workspace directory.

Go figure.

12 comments:

  1. This happened to me when upgrading to Eclipse Ganymede. When I opened my old workspace under Ganymede and tried to do and 'ant clean' it just sat there looking at me. All of my Ant jars were pointing to the old (Eclipse Europa) ant directory.

    Thanks for being the top Google hit for 'eclipse ganymede ant'!

    ReplyDelete
  2. Thanks mate,

    you just saved me a lot of time figuring that out!

    ReplyDelete
  3. Thank you... I just found you via Google and you saved my day. Installing my workspace on a new laptop and did not understand at all why ant behaved so stupidly...

    ReplyDelete
  4. Thank you for your help. I had different problem - when trying to open build.xml in editor I was getting NullPointer exception. Spent hours looking for solutions, tried Restore Defaults to no avail. Thanks to your post look into Ant Home and it was pointing to the working directory...
    XP, Ganymede

    ReplyDelete
  5. thanks for the help. You made my day :-).

    dat pika²

    ReplyDelete
  6. I encountered this problem when moving an Eclipse installing to a different machine - thanks for taking the time to post this!

    ReplyDelete
  7. KUDOS to you, saved me a lot of time!

    ReplyDelete
  8. much appreciated - was still having this issue in Galileo. all good now.

    ReplyDelete
  9. I just hit this problem as well. Even though the post is a couple of years old, it is still very helpful. The issue was solved in seconds with your recommended fix, thanks!

    ReplyDelete
  10. This solved the problem I was having with attempting to build my files using build.xml.

    Saved me a lot of time trying to get to the root cause of this issue.

    Thanks!

    ReplyDelete
  11. Hi Mike! how are you doing? we used to be at BroadRidge!Just wanted to say hi!

    ReplyDelete