3

I am using Eclipse IDE for Java Developers

Version: Helios Service Release 2 Build id: 20110218-0911

I have a problem similar to this stackoverflow question

On reading other questions, I have found that the error

This element has no attached source and the Javadoc could not be found in the attached Javadoc

is caused by Eclipse not being able to locate the javadoc file.

I checked, I have both JDK and JRE in c program files / java location. I have src.zip file at C:\Program Files\Java\jdk1.6.0_30, I have src lib file at C:/Program Files/Java/jre6/lib/rt.jar

Both these paths are set in classpath variables.

Installed JRE is referring to C:\Program Files\Java\jre6 and javadoc location for all JRE system libraries is set to http://java.sun.com/javase/6/docs/api/

But still I am not able to see the javadoc on mouse hover of any java or android methods

Do you have any advice on how to get this working?

Community
  • 1
  • 1
adityag
  • 603
  • 3
  • 8
  • 24

4 Answers4

7

enter image description here

In Eclipse, go to Window, Preferences, and navigate to the javadoc options or type javadoc where it says 'type filter text'. Check if the options 'Process Javadoc comments' is checked. It may ask you to do a full rebuild of your projects after you check/uncheck that option.

ThiagoPonte
  • 279
  • 2
  • 11
  • 3
    This is currently the top hit on Google for "eclipse javadoc not working" so I'll leave this here. Un-checking, applying, rechecking, and reapplying worked for me when I lost Javadoc while working in a pure Java environment. – Alex N. Aug 26 '13 at 12:16
  • You might need to do the same for your projects with *Configure Project Specific Settings...* (top link in the Javadoc panel). – BairDev Aug 19 '22 at 09:52
2

Had the same problem with Eclipse Mars (4.5.1). I needed to assign the Source attachment of rt.jar to the src.zip manually:

  • Navigate to your project's property page: Project > Properties > Java Build Path > JRE System Library > rt.jar > Source attachment.
  • Click Edit..., choose External location and put the path to src.zip here.
pogosama
  • 1,818
  • 1
  • 24
  • 29
2

You seem to be developing an Android App in Eclipse. When you have the ADT plugins installed you are no longer using the standard Java JDKs, but rather the android versions.

To fix this you'll want to Install "Documentation for Android SDK" package using Android SDK and AVD Manager. This will place the documentation folder into the android sdk location suitable for eclipse + the ADT plugins to supply you javadoc help popups.

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
  • Hi i just downloaded documentation for android for api 15 from sdk manager. I can see docs folder added in my sdk manager for windows folder. But still I couldnt figure out how to point eclipse to catch that D:\android-sdk-windows\docs folder. can u pls guide further ? – adityag Jan 12 '12 at 18:40
  • 1
    Ok, I added file:/D:/android-sdk-windows/docs/reference/ to javadoc location (option found by right click on project and selecting option properties. It said location is likely to be valid and i could open java doc in browser. but still on mouse hover, i am not seeing java doc tips for both java and android methods :( – adityag Jan 12 '12 at 18:56
0
  1. Navigate to that method by Ctrl+Click on the method. The new tab/window will opened with text "Source not found" and button "Attach Source" in it.
  2. Click the button "Attach Source" New window pops up.
  3. Click the button "External Folder".
  4. Click the button "External File"
  5. If you are on Windows with default installation settings, then the folder path is C:\Program Files\Java\jre1.8.0_151\lib and then click on rt.zip file and click on "Open".
  6. Click the button "OK"

Hope this answers your question.

PrashantNagawade
  • 426
  • 1
  • 6
  • 24