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
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
Page: http://www.oracle.com/technetwork/java/javase/documentation/java-se-7-doc-download-435117.html
- Extract the zip file in your local directory.
- From ecliplse --> Window --> Preferences --> Java --> "Installed JREs" select available JRE (jre6 C:\Program Files (x86)\Java\jre6 for instance) and click Edit.
- Select all the "JRE System libraries" using CTRL key.
- Click "Javadoc Location"
- Change "Javadoc location path:" from "http://download.oracle.com/javase/6/docs/api/" to "file:/E:/Java/docs/api/".
Alternatively:
To view the standard Java JDK API documentation for all the classes that come with Java open up the tree in the "Package Explorer" for the JRE System Library, select
rt.jar
(the runtime library)
From the "Navigate" menu select "Open External Javadoc" and you will see the Java API documentation. The default location of the documentation is Sun's website so the URL in the browser will be something like
http://java.sun.com/j2se/1.7.0/docs/api/index.htmlTo use our own local version of the documentation in
file:/C:/Program Files/Java/jdk1.7.0_04/docs/api/so that we don't need to connect to the internet each time we want to view the documentation.
To make the change right click on the
rt.jar
entry in the "Package Explorer" and select "Properties" to get the dialog box
We need to change the URL in the "Javadoc location path". You can either type in the local value directly or use its browse button to navigate to
Click "OK" and you should have the dialog box
showing the local URL
file:/C:/Program Files/Java/jdk1.5.0_04/docs/api/
Click "Apply" and then "OK".
Now to see the API documentation select
rt.jar
and choose "Open External Javadoc" from the "Navigate" menu (shortcut is Shift F2). Your local URL will now be shown in the browser address bar.
No comments:
Post a Comment