RSS Entries RSS
RSS Subscribe by Email

Running Ant within Eclipse

I tried to run an Ant target within Eclipse today and got a fun error:

BUILD FAILED

java.lang.NoClassDefFoundError: com/sun/javadoc/Type

This happened because Ant could not find tools.jar, which contains classes to used to run javac and javadoc. The solution:

  • Open up Window->Preferences->Java->Installed JREs
  • Set your default JRE to a JDK/SDK
  • Open up the one you just set as default, click “Add External JARs”, and then add tools.jar located in the JDK lib directory.

Eclipse’s Edit JRE Screen

Share and Enjoy:
  • Add to favorites
  • HackerNews
  • DZone
  • Reddit
  • del.icio.us
  • StumbleUpon
  • Slashdot
  • Digg
  • Google Bookmarks
  • Facebook

Tags: , ,

1 Comment »

  1. ajay said,

    October 6, 2009 at 9:42 pm

    Good Explanation.Got it working!!!

RSS feed for comments on this post · TrackBack URL

Leave a Comment