12

I am using a third party library, i have included into my project. It contains classes for the application, but no sources, or Javadoc. As expected, mouse-over imported object shows no javadoc.

Note: This element neither has attached source nor attached 
Javadoc and hence no Javadoc could be found.

After googling for a bit, i came across 3 versions of jars

  1. app.jar
  2. app-sources.jar
  3. app-javadoc.jar

It appears and app-javadoc.jar contains nothing but html pages and app-sources contans nothing but .java files (with Javadoc comments).

What i did:

  • Added all 3 files to the list of "Referenced Libraries". After "refresh"ing the project, javadoc still does not show.

  • Additionally, under properties for the project, i pointed "Javadoc location path" to unzipped content of app-javadoc.jar (validated ok)

Still, after having done all that, my Eclipse fails to display javadoc.

Please advise

Thank you.

James Raitsev
  • 92,517
  • 154
  • 335
  • 470

3 Answers3

25

Add only app.jar to the Referenced Libraries.

then, go to Project Explorer, right click on the jar file-> Properties -> Javadoc Location and add Javadoc jar location (app-javadoc.jar).

If you want to also browse the source code, then go to 'Java Source attachment' in the same dialog box and add the app-sources.jar there.

Rahul
  • 12,886
  • 13
  • 57
  • 62
6

I think you should set the javadoc location to the library itself but not the Project's javadoc location property.

Project > Properties > Java Build Path > Libraries expand the app.jar node and select the "Javadoc location" sub node and you can see the "Edit" button at the right of the library tree is enabled. Then click the "Edit" button and you can choose your javadoc in a jar file.

I am using Eclipse not MyEclipse but I think they are similiar. FYI

YODA
  • 309
  • 1
  • 3
0

Here is an answer as of 2016-05-12:

In the Eclipse Project Explorer, under Referenced Libraries, right click on the jar file for which you require documentation. In the present example I require documentation for the Apache Commons IO library.

enter image description here

Select Properties. Then select Javadoc Location:

enter image description here

In the case that I am considering--the Apache Commons IO library--the javadoc jar file is stored in the same directory as the library jar file. In the Properties dialog, select Javadoc in Archive, navigate to the relevant directory, and click on the javadoc jar file:

enter image description here

Click Open, click OK, and you're done. As shown below, when you hover your cursor over an Apache Commons IO class name the javadoc appears:

enter image description here

Argent
  • 885
  • 2
  • 9
  • 18