Off-Line Java API Documentation in Eclipse?
Is there an integration of any other off line way to get the Java API docs开发者_如何学JAVA?
If you have no internet connection on your development machine, or if you want to stop the Web traffic for accessing the documentation, you can store the documentation on your local hard drive.
- Start your favorite Web browser and navigate to http://www.oracle.com/technetwork/java/javase/downloads/index.html#docs
- Find your desired documentation, accept the license agreement, and then click the link displayed under the
Download
header. - In Eclipse, open the
Window
menu, then selectPreferences
. - In the search bar, type
jre
, and then clickInstalled JREs
. - Select the one named
java
, or another term likejre1.8.0_181
.- Its type must be
Standard VM
.
- Its type must be
- Click the
Edit
button. - In the
JRE system libraries
section, select the library ending withrt.jar
, and click theJavadoc Location...
button. - Mark the
Javadoc in archive
radio button. - In the
Archive path
field, enter orBrowse
for your full documentation path (e.g./home/docs/jdk-8u181-doc.zip
). - In the
Path within archive
field, enter orBrowse
for the location of theapi/index.html
file (e.g.docs/api
). - Click the
Validate
button to ensure everything is set correctly. - Click the
OK
button, then theFinish
button, and finally theApply & Close
button. Your documentation is now linked to the file you specified.
Just a quick contribution: Instead of selecting 7 "Javadoc in archive", I changed the javadoc location path (URL) to my directory, where I have unzipped my doc. Hope its help!!!
This worked for me (Java 8):
Go to your JDK installation. (
C:\Program Files\Java\jdk1.8.0_66
for me).Unzip the
src.zip
file (becomesC:\Program Files\Java\jdk1.8.0_66\src\
for me).In the Eclipse editor window:
CTRL + Click
on ajava.lang
library class. (something likeString
).Eclipse will complain
Source not found
and tell you that you don't have the source.Click
Attach source
->External Location
->External Folder
.Find your source folder (
C:\Program Files\Java\jdk1.8.0_66\src\
for me).Click
OK
->OK
.Enjoy.
精彩评论