I tried to run an Ant target within Eclipse today and got a fun error:
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.