score:67

Accepted answer

you can try to ctrl + click on a class that has no source attached (do that in editor). when it shows you some info about the class you'll see the button that guides to attach source dialog. click it and in dialog that pops up pick the source/javadoc location for your class.

you can also do that from project build path settings you are mentioning: pick libraries tab, expand the library (jar) you want and you'll be offered to pick: source attachment, javadoc attachment, native library location, etc. you just pick whatever you want and edit its current settings.

or you can do as @jb nizet said...

score:0

the easiest way is :

  1. press control+(the word for which you want to see the java doc)
  2. a page will appear that has a button for attach source.click this
  3. select external location.
  4. browse the location to java folder than your jdk .than select src .zip.
  5. press ok.

the problem is solved.

score:9

you can also edit the classpathentry in the file ".classpath" in your eclipse project. this can be helpful if you want to modify many entries at once or if you want to generate the path. e.g.:

<classpathentry kind="var" path="home/3rdparty/junit.jar" sourcepath="/source/junit_src.zip"/>

score:11

right-click on the jar (the one with the class files), choose "properties", the "javadoc location", and choose the jar file with the javadoc. do similarly for the source jar, using "java source attachment".

score:71

  1. right click over the project -> build path -> configure build path
  2. in the new window, go to the "libraries" tab.
  3. select the library and expand it.
  4. there are 4 child options. select "javadoc location" and click the "edit" button on the right.
  5. now you can add a jar file containing the docs. this would be just a zip file with the extension changed to jar. make sure inside the jar the index.html is in the root. you can press the "validate" button to check everything is ok.

Related Query

More Query from same tag