Reputation: 3776
The help for Java in Eclipse (ordinary Java development, not Android), is set to an online URL at Oracle's server, linked to http://docs.oracle.com/javase/6/docs/api/. However, with one specific computer, I cannot be online during a Java class I teach. So I want to use a local help.
I tried the following:
windows - preferences - java - installed jre
There I see the link to the online help. I tried to use the source archive instead, the src.zip
folder in the JDK directory. But that does not work. The source does not contain compiled Java doc anyway.
Do I have to download the API docs? And if, where?
Upvotes: 9
Views: 31925
Reputation: 3776
Of course, I had already installed a JDK with a source. On the machine I found a JRE7 and JDK1.7xxx, and the projects use the JRE7.
In Window - Preferences - Java - Installed JRE I found a link to the JRE7, which does not contain sources or a Javadoc.
So I pressed "Edit" and browsed the directory to the JDK1.7, then pressed "Restore Default". This will change the JRE system libraries to the JDK. The Javadoc locations for rt.jar and the other jars is now at Oracle, but nevertheless the installed src.zip is used, if there is no internet connection.
Alternatively, it is indeed possible to attach the src.zip file (file!) to the rt.jar of JRE7.
Upvotes: 6
Reputation: 5487
I encountered this issue. It was because the JRE I was using was not the JDK's JRE.
First, update your default JRE:
<JDK directory, not ./bin>
> OKThen, update your existing project to use that JRE:
You should have JavaDocs for the JRE library now! 😊☕
If not, you may need to refresh the JavaDoc settings by going Window > Preferences > Java > Compiler > Javadoc, and uncheck/apply/recheck/apply the Process Javadoc comments
checkbox.
Upvotes: 1
Reputation: 5996
If I remember correctly you don't need the API docs at all if you have src.zip
available and set up. Eclipse should pick up the Javadoc from the sources as it does with your own code.
Edit: How to setup src.zip
:
src.zip
file.Upvotes: 0
Reputation: 15525
There are different options (as @siegi and @Thorbjorn_Ravn_Andersen have told), and it depends, on what you want to do:
However, in a class I would like to tell people to use their IDE all of the time, so I think browsing the source online is much more natural (for a Java developer), and you are pretty sure that you see the documentation that was written to the sources you are using.
If you want to get some overview of packages or classes, it may be more convenient to use the API in a browser.
Upvotes: 0
Reputation: 75376
You can download the Java 7 javadoc from
http://www.oracle.com/technetwork/java/javase/documentation/java-se-7-doc-download-435117.html
Upvotes: 3