Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add the Java API documentation to Eclipse?

I have downloaded Java API documentation from http://www.oracle.com/technetwork/java/javase/downloads/index.html#docs and have supposedly attached it to Eclipse using the

Window->Preferences->Java->Installed JREs->Edit->"Select rt.jar"->Javadoc Location

And the location has been accepted and "Validates" just fine. However, for the life of me, I can't get Eclipse to show the Javadocs in the tooltip whene I hover over an item (for example in the declaration of an ArrayList). I have also restarted Eclipse in attempts to get it to work

What am I doing wrong?

like image 329
Kurru Avatar asked Jan 05 '11 01:01

Kurru


People also ask

How do I import a Java document?

"Right Click the JAR file in Project Explorer -> Properties -> From the left pane choose Javadoc Location -> enter the URL of your jar documentation. Generally you can Google for: javadoc lib-name and then pickup the URL of the first site suggested by Google - going up a level." Hope this helps!

How do I Download Java API documents?

Go to the Java SE page, select the Downloads tab and under the Additional downloads, there're Download buttons for the docs.


1 Answers

To use offline Java API Documentation in Eclipse, you need to download it first. The link for Java docs are (last updated on 2013-10-21):

Java 6
Page: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-doc-download-355137.html
Direct: http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-apidocs.zip

Java 7
Page: http://www.oracle.com/technetwork/java/javase/documentation/java-se-7-doc-download-435117.html

Java 8
Page: http://www.oracle.com/technetwork/java/javase/documentation/jdk8-doc-downloads-2133158.html

Java 9
Page:http://www.oracle.com/technetwork/java/javase/documentation/jdk9-doc-downloads-3850606.html

  1. Extract the zip file in your local directory.
  2. From eclipse Window --> Preferences --> Java --> "Installed JREs" select available JRE (jre6: C:\Program Files (x86)\Java\jre6 for instance) and click Edit.
  3. Select all the "JRE System libraries" using Control+A.
  4. Click "Javadoc Location"
  5. Change "Javadoc location path:" from "http://download.oracle.com/javase/6/docs/api/" to "file:/E:/Java/docs/api/".

It must work as it works for me. I don't need Internet connection to view Java API Documentation in Eclipse anymore.

like image 90
cslraju Avatar answered Sep 25 '22 13:09

cslraju