9

How do I configure IntelliJ to access offline documentation (for both Java and Android if possible) without leaving my IDE? I'm using IntelliJ IDEA 13.1. My Android application is building and running fine so my installation seems to be correct. I've examined the relevant SO posts:

But either the paths they recommend are not on my machine (the posts are rather dated) or else too vague. Interestingly my /Library/Java/JavaVirtualMachines folder seems to be empty whether I use Finder or Terminal. My Documentation paths tab under the File | Project Structure menu item is empty.

I should add that I'm attempting to use the Shift+F1 keyboard command when I have a keyword highlighted. That's what is recommended, but nothing happens. Below are pics of my current documentation paths in the Project Structure dialog. All done according to recommendations as far as I can see, but maybe someone can spot something.

enter image description here

enter image description here

enter image description here

Community
  • 1
  • 1
Alyoshak
  • 2,696
  • 10
  • 43
  • 70

2 Answers2

5

I think configuring the path to src.zip should be enough, IntelliJ will retrieve the Javadoc from the source files. In Modules Settings, in the SDKs panel choose your current SDK, go to the Sourcepath tab and make sure there's an entry for src.zip.

On OSX it's located under

/Library/Java/JavaVirtualMachines/jdk1.7.0_10.jdk/Contents/Home/src.zip

or

/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/src.zip

depending on which SDK you have and how you installed it.

For the Android doc, I guess you can do the same if they provide a zip containing all the source files.

Bastien Jansen
  • 8,756
  • 2
  • 35
  • 53
  • As an addendum to @Nebelmann's answer, you can find out where all your JDK installations are on MacOS X by executing the command `/usr/libexec/java_home -V` – Steve C Nov 02 '14 at 03:03
  • I think I found the right place, but fyi there's no "Sourcepath", but a "Path" tab. 1) It would not let me specify the filename. If I tacked "src.zip" onto the end and clicked OK it wd not accept that. The dialog would not close and an error message at bottom appeared in red text: "Specified path cannot be found". 2) If I omitted "src.zip" it would accept that, but Shift+F1 still does nothing. I restarted IntelliJ afterwards fyi. – Alyoshak Nov 05 '14 at 22:20
  • @Nebelmann -- Your answer was correct. When I had a chance to mess with it again I realized I had src.jar files in that location rather than src.zip. But that's a technicality. Thanks. I often work in a remote location and needed this to work. – Alyoshak Nov 18 '14 at 22:39
0

Command + ; open Project Structure

on left panel select SDKs

in Sourcepath tab click +, select your src.zip

enter image description here

Rene Xu
  • 1,093
  • 1
  • 9
  • 14