简体   繁体   中英

How to configure IntelliJ for Mac to show Java and Android documentation within the editor (offline, not online)?

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 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.

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

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.

Command + ; open Project Structure

on left panel select SDKs

in Sourcepath tab click +, select your src.zip

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM