本文介绍了Mac OS X上的IntelliJ IDEA中的JDK文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我想知道如何设置IntelliJ以指向JDK文档,以便在代码完成期间显示的文档弹出窗口将向我显示我正在查看的功能。出于某种原因,IntelliJ默认情况下无法找到JavaDoc。

I'd like to know how to setup IntelliJ to point to the JDK documentation so the documentation popups that display during code completion will show me what the function I'm looking at is going to do. For some reason IntelliJ isn't able to find the JavaDocs by default.

我也不是100%确定文档是随着安装了JDK的JDK一起安装的。 OS。我没有在/System/Library/Frameworks/JavaVM.framework/中看到它们,但我可能看错了地方。如果没有包含它,我还想知道需要下载什么以及需要安装的位置以使JDK的JavaDocs显示在IntelliJ中。

I'm also not 100% sure that the documentation is installed with the JDK that's installed with the OS. I don't see them in /System/Library/Frameworks/JavaVM.framework/ but I may be looking in the wrong place. If it's not included, I'd also like to know what needs to be downloaded and where it needs to be installed to get the JavaDocs for the JDK to show up in IntelliJ.

推荐答案

我必须结合我对这一点的回应并添加一些额外的细节,以便我回答我自己的问题。

I had to combine the responses I got to this point and add a few extra details so I'm answering my own question.



  1. 下载并安装Java for Mac OS X 10.6 Update 9 Developer Package(或更高版本)。

  2. 在IntelliJ中,打开文件 - >项目结构。

  3. 点击平台设置下的SDK。

  4. 在文档下添加以下路径路径选项卡(路径可能因您使用的JDK而异):

  1. Search for "Java developer" from Downloads for Apple Developers
  2. Download and install "Java for Mac OS X 10.6 Update 9 Developer Package" (or later).
  3. In IntelliJ, open File -> Project Structure.
  4. Click on "SDKs" under "Platform Settings".
  5. Add the following paths under the "Documentation Paths" tab (the paths may be different based on which JDK you're using):

/Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home/docs.jar!/docs/api
/Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home/appledocs.jar!/appledoc/api


  • 在Sourcepath选项卡下添加以下路径:

  • Add the following path under the Sourcepath tab:

    /Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home/src.jar!/src
    


  • 感谢@Yishai下载地点和@Gareth Davis安装后文档的位置。

    Thanks, @Yishai for the download location and @Gareth Davis for the location of the documentation after installing.

    更新10.7 / 10.8 [Mountain] Lion:

    除了这些更改外,步骤相同:

    Steps are the same except for these changes:


    1. 在第2步中,下载Java for OS X 2012-005 Developer Package(或更高版本)。

    1. In step 2, download "Java for OS X 2012-005 Developer Package" (or later).

    在步骤5中使用这些路径。

    Use these paths instead in step 5.

    /Library/Java/JavaVirtualMachines/1.6.0_35-b10-428.jdk/Contents/Home/docs.jar!/docs/api
    /Library/Java/JavaVirtualMachines/1.6.0_35-b10-428.jdk/Contents/Home/appledocs.jar!/appledoc/api
    


  • 在步骤7中使用这些路径。

  • Use these paths instead in step 7.

    /Library/Java/JavaVirtualMachines/1.6.0_35-b10-428.jdk/Contents/Home/src.jar!/src
    


  • 这篇关于Mac OS X上的IntelliJ IDEA中的JDK文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

    1403页,肝出来的..

    09-06 22:21