How to view JDK external documentation in IntelliJ IDEA?

前端 未结 7 899
南旧
南旧 2020-11-29 19:10

The shortcut for this action is Shift+F1 but it is always grayed out even I have pointed JDK documentation path to the docs folder (the docs folder

7条回答
  •  鱼传尺愫
    2020-11-29 19:35

    I understand the question as follows:

    You would like to see javadocs of classes that are not within JDK. I am a bit uncertain because CrazyCoder's reply is talking about JDK specific javadocs.

    I am using Macos 10.8.4 and Intellij 11.1.5
    

    The project I am working on is a mvn based project with many modules which have complex dependencies.

    Let me take a concrete example to explain what I did, I am sure it can be reproduced for others: apache sshd

    I downloaded the javadoc from maven central stored it stored it somewhere. In intellij I went to the module settings (shortcut F4) and the to Libraries in the sidebar. Maven pulls all dependencies automagically and I can find sshd there. The right side then shows Classes, Sources and JavaDocs. The JavaDocs part in my case had a path linked in that pointed to my local m2 directory. However the directory did not contain the javadoc jar file. So I thought how do I get it:

    mvn dependency:resolve -Dclassifier=javadoc
    

    Taken from here

    However this failed for because we do not have some javadocs in our nexus (I guess, not sure).

    So I ended up linking the file that I downloaded manually in as a javadoc link and this then allown me to use Shift+F1 for the javadoc to open in my standard browser.

    Maybe others can elaborate on how to get this done with mvn. I did not have the time to further investigate.

提交回复
热议问题