I'm having issues seeing API documentation for Java 8 in Eclipse. Here's an example of the problem I'm having
Calendar myCalendar = Calendar.getInstance();
If I mouse over Calendar
then I see all the correct documentation, however if I mouse over getInstance()
I get a message saying
Note: This element has no attached source and the Javadoc could not be found in the attached Javadoc.
I have the Javadoc location for rt.jar set to http://docs.oracle.com/javase/8/docs/api/, I've also tried downloading a local copy of the docs and had the same problem. Changing the link to the Java 7 docs fixes the problem I'm having.
Eclipse seems to be using the wrong anchor style (not sure how else to word it) when looking for methods. When it looks for the getInstance()
method, it checks http://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html#getInstance(), but it should be checking
Calendar.html#getInstance--
All brackets and commas seem to have been replaced by hyphens in the Java 8 doc links. I experienced this problem with Eclipse 4.3 (Kepler), 4.3 with the patches for Java 8, and now with 4.4 (Luna)
Is there a way to update Eclipse so that it properly displays the docs in the mouse over tooltips?
Step 1 − Open eclipse, select the option Project →Generate Javadoc. Step 2 − Select the javadoc.exe file from the bin folder of java installation directory, select the destination folder for the generated java doc and select Next. finish button.
Eclipse requires Java 11 to run, but supports also older versions (starting with Java 1.1, up to Java 15, and of course Java 8). You can target any Java version you want if you install the proper runtime. Just because eclipse itself requires Java 11 doesn't mean it can't compile for lower versions.
Window->Preferences->Java->Installed JREs. Once you have that set up, you might be interested in the Javadoc view: Window->Show View->Javadoc.
Moreover, in Eclipse you can just go to Preferences -> Maven (No subcategory). There, you can check "Download artifact Sources/JavaDocs".
Setting the installed JRE to JDK 8 fixes your problem.
This can be done by going to
Window -> Preferences -> Java -> Installed JRE -> Edit -> Directory and selecting the JDK 8 installation folder
Step 1: Windows -> Preference -> Java -> Installed JRE -> Edit -> Directory (Specify the JDK directory (and not JRE))
Step 2: Click "Restore Defaults"
Step 3: Click OK
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With