Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • How to view JDK external documentation in IntelliJ IDEA?
  • JDK documentation in IntelliJ IDEA on Mac OS X)
  • IntelliJ and the android java docs

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

like image 506
Alyoshak Avatar asked Oct 23 '14 16:10

Alyoshak


People also ask

How configure Java SDK IntelliJ Mac?

From the main menu, select File | Project Structure | Project Settings | Modules. Select the module for which you want to set an SDK and click Dependencies. If the necessary SDK is already defined in IntelliJ IDEA, select it from the Module SDK list.

How do I show documents in IntelliJ?

You can view documentation by placing the caret at a symbol and pressing Ctrl+Q or selecting View | Quick Documentation from the main menu.

How do I add Java documents to IntelliJ?

From the main menu, select Tools | Generate JavaDoc. In the dialog that opens, select a scope — a set of files or directories for which you want to generate the reference, and set the output directory where the generated documentation will be placed.

How do I turn off offline mode in IntelliJ?

Go to Preferences -> Build,Execution,Deployment -> Build Tools -> Maven Uncheck the Work Offline option.


1 Answers

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.

like image 133
Bastien Jansen Avatar answered Nov 14 '22 22:11

Bastien Jansen