adityag
adityag

Reputation: 603

Javadoc not available in Eclipse

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?

Upvotes: 3

Views: 23926

Answers (4)

PrashantNagawade
PrashantNagawade

Reputation: 426

  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.

Upvotes: 0

pogosama
pogosama

Reputation: 1908

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.

Upvotes: 2

Joakim Erdfelt
Joakim Erdfelt

Reputation: 49545

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.

Upvotes: 2

ThiagoPonte
ThiagoPonte

Reputation: 289

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.

Upvotes: 8

Related Questions