Reputation: 131
Whenever I try to access the Javadoc for any class in Eclipse by hovering over a reference to it, it either says An exception occurred while getting the Javadoc
or This element has no attached source and the Javadoc could not be found in the attached Javadoc
. I've read through several solutions on StackOverflow and have tried them all including:
Validate
on it it even says the location is likely valid.The weird thing is, if I click on View Javadoc in Browser
it opens directly to the correct Javadoc.
Upvotes: 1
Views: 414
Reputation: 1446
Windows->Preferences -> Installed JRE -> click on the JDK ->JRE Deifination will open -> In RT.JAR attach java source as shown below:
Upvotes: 1
Reputation: 17567
As you can see in the exception message, Eclipse is currently using the JRE
instead of the JDK
, since it is set up as the primary one (according to the second screenshot). Remove the JRE library
from the project, you don't need it anymore. The JDK
contains everything you need, including the JavaDoc.
Upvotes: 0