views:

543

answers:

2

I was trying to add Ant libraries to a project in eclipse, and I used the ones that were part of eclipse's plugins folder. When I tried to associate them with Javadocs, I couldn't locate them in the plugin folder. I searched for them online, and I found this page, in which they say the docs are not provided online because they are part of every distribution. So where can I find the docs in the distribution that came bundled in Eclipse?

+2  A: 

The ant javadocs may or may not be included with eclipse, depending on which version you have. Edit: Anyway, it's better not to depend on the version bundled with the IDE. Otherwise everyone who works on the project will have to use the same version of the IDE, and eclipse automatic updates can break your project.

  • Download the ant binary distribution and ant source distribution
  • Take the eclipse ant distribution out of your project and replace it with the binary jars (extracted from the zip).
  • In the eclipse java build path window attach the source zip to the binary jars. (Click the plus, double click "Source attachment" and select the source zip. You'll be able view the source if you want, and the javadoc will appear in the appropriate views.
Craig P. Motlin
Thanks for the suggestion. But why shouldn't I use the eclipse ant distribution?
Hosam Aly
Good remark. I did not made that comment because it did not exactly answer Hosam's question, but your approach is safer. Internal eclipse plugins are for eclipse to use, not for the user. +1
VonC
Very informative. Using the bundled library wasn't a problem for me though, as it was for compiling an open-source project just once. But I'll keep your advice in mind. Thanks.
Hosam Aly
+2  A: 

I do not completely agree with Motlin's answer:
the process described is correct ("attach the source zip to the binary jars"), except the source code of all ant components is provided with eclipse distribution.

If ant is a plugin for eclipse, in [eclipsePath]\eclipse\plugin\org.apache.ant_1.7.1, [eclipsePath]\eclipse\pluginalso contains org.apache.ant.source_1.7.1.jar, including within it all the sources.


I confirm [eclipsePath]\eclipse\plugin\org.apache.ant_1.7.1 is there, but only in the SDK distributions of eclipse with sources included:

  • SDK eclipse (or "classic eclipse)
  • Modeling
  • RCP for plugin development.

This table summarizes the eclipse distros which come with sources included.

So, in the event you do not have access to any other ant stand-alone deliveries, you could use one of this eclipse distros to program and find in it a full ant distribution.

However, as pointed by Motlin, that is not the safest path to consider.

VonC
Interesting, I've modified my answer.
Craig P. Motlin
Thanks. But I couldn't find it on my machine in the path you specified. Maybe because my eclipse isn't configured for plugin development?
Hosam Aly
org.apache.ant.source_1.7.1.jar is for eclipse3.5. For Ganymede, eclipse3.4, it may still be org.apache.ant.source_1.7.0.jar. I will check that tomorrow
VonC
Sorry, I meant I didn't find the source (regardless of the version).
Hosam Aly