如何将 javaDoc 添加到基于 NetBeans 的项目中的 Java 代码?

发布于 2024-10-15 18:42:50 字数 470 浏览 7 评论 0原文

如何将 JavaDoc 或其他文档添加到 netbeans ?
我尝试用这种方式:

Tools >> Java Platform >> JavaDoc Tab >> JavaDoc.zip (in my desktop) 

但是在编辑器中,当我在工具提示文本中按 Ctrl+Space 时,显示此消息:

未找到 Javadoc。该项目的 Javadoc 文档不存在,或者您尚未在 Java Platform Manager 或 Library Manager 中添加指定的 Javadoc。

我尝试重新启动 NetBeans,但结果是这样的:

在此处输入图像描述

How can I add JavaDoc or other document to netbeans ?
I try with this way :

Tools >> Java Platform >> JavaDoc Tab >> JavaDoc.zip (in my desktop) 

but in editor when I press Ctrl+Space in tooltiptext this message shown :

Javadoc not found. Either Javadoc documentation for this item does not exist or you have not added specified Javadoc in the Java Platform Manager or the Library Manager.

I tried restarting NetBeans but this was the result:

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

罪#恶を代价 2024-10-22 18:42:50

在 NetBeans IDE 中尝试此操作

  1. 选择“工具”>“主窗口中的 Java 平台管理器。
  2. 在对话框的左侧面板中选择要添加 Javadoc 的平台。
  3. 在 Javadoc 选项卡中,单击添加 ZIP/文件夹并指定 Javadoc 文件的位置。
  4. 单击“关闭”。

希望这有帮助。

try this in NetBeans IDE

  1. Choose Tools > Java Platform Manager from the main window.
  2. Select the platform to which you want to add Javadoc in the left panel of the dialog box.
  3. In the Javadoc tab, click Add ZIP/Folder and specify the location of the Javadoc files.
  4. Click Close.

Hope this helps.

一影成城 2024-10-22 18:42:50

如果您在项目中使用 Maven,请按照以下步骤为您附加的库附加 Java 文档。

  1. 右键单击项目的“依赖项”文件夹。
  2. 然后选择“下载 javadoc”选项
  3. 它将下载您的库的 javadoc 并将其附加。
  4. 现在,当您按 ctl + space 时,您将看到该库的文档。

如果您想为特定库添加 javadoc,请按照 Himanshu Soni 建议的选项进行操作。

If you are using maven in your project then follow below steps to attach Java docs for your attached libraries.

  1. Right click on "Dependencies" folder of your project.
  2. Then choose "Download javadoc" option
  3. It will download javadoc of your libraries and attached it.
  4. Now when you will press ctl + space then you will see docs for that library.

and If you want to add javadoc for particular library then follow the options as suggested by Himanshu Soni.

再浓的妆也掩不了殇 2024-10-22 18:42:50

通常,您不能将 javadoc zip 添加为单独的库(至少这在过去对我来说不起作用。)在库部分中,您需要选择要为其添加 Javadoc 的库,然后添加该特定库的 Javadoc jar。

重新启动 Netbeans 然后就可以了。当然,如果确实没有该方法的 Javadoc,您仍然不会得到任何内容(我之前已经陷入过这个陷阱好几次了!)

You can't usually just add the javadoc zip as a separate library (at least this hasn't worked for me in the past.) In the libraries section you need to select the library you want to add the Javadoc for and then add the Javadoc jar for that specific library.

Restart Netbeans then that should work. Though of course if there really is no Javadoc for that method you still won't get any (I've fallen into that trap a couple of times before!)

请远离我 2024-10-22 18:42:50

你遵循了非常正确的程序,在我写这个答案之前我就已经抛出了这个问题,至于这是当你谷歌这个问题时出现的第一个结果,我想很多人会发现它很方便并节省时间,解决方案是:

解压缩您所引用的 JavaDoc.zip 文件(对于 JavaSE 7 文档,该文件应该是 jdk-7u4-apidocs.zip)并重复相同的过程,即“工具 -->” Java 平台 --> Javadoc ( tab ) 然后按“添加Zip/文件夹,并指向解压的文件夹而不是压缩的文件夹,重新启动 NetBeans,它将顺利而直接地工作。

您应该从以下链接下载文档文件:
http://www.oracle .com/technetwork/java/javase/documentation/java-se-7-doc-download-435117.html

完成所描述的操作后,您将可以离线使用您的javadocs,并且您不需要连接到互联网以了解 API。

最好的问候兄弟。

You followed the very right procedure, I've been threw this right before I write this answer, and as for this is the first result that shows up when you Google the problem, I think that many people will find it handy and save their time, the solutions is:

UNZIP the JavaDoc.zip file that you are referring to ( which is supposed to be jdk-7u4-apidocs.zip for JavaSE 7 docs) and repeat the same procedure, which is Tools --> Java Platforms --> Javadoc ( tab ) then press " Add Zip/Folder, and point to the unzipped folder instead of the zipped one, restart NetBeans, and it will work smooth and direct.

You should download the docs file from the following link:
http://www.oracle.com/technetwork/java/javase/documentation/java-se-7-doc-download-435117.html

After completing the described operation, you will have your javadocs available offline, and you don't need to be connected to the internet to know about APIs.

Best regards brother.

稀香 2024-10-22 18:42:50

工具>>Java平台>>JavaDoc选项卡>>JavaDoc.zip

上述步骤的问题可以通过沿着内容面板中已添加的两条路径向下移动来轻松解决如下所示。

第 1 步-

  • 转到:工具>> Java平台>> JavaDoc 选项卡
    并添加您要添加​​的 ZIP/文件夹。

步骤 2-

  • 在此处输入图像描述

步骤 3-

  • 在此处输入图像描述

就这些,如果 zip 文件不起作用,请先解压,然后添加它。

"Tools >> Java Platform >> JavaDoc Tab >> JavaDoc.zip"

The problem with above step can be solved easily by moving down following two path already added in content panel as shown below.

Step 1-

  • Goto: Tools >> Java Platform >> JavaDoc Tab
    and Add ZIP/Folder you want to add.

Step 2-

  • enter image description here

Step 3-

  • enter image description here

That's all and if zip file doesn't works the extract first and then add it.

染柒℉ 2024-10-22 18:42:50

我遇到了同样的问题,我通过删除所有 URL 并仅添加从 oracle 下载的 apidocs.zip 解决了这个问题。之后重新启动您的 NetBeans。

在测试它是否有效之前,请确保您正在寻找的方法确实存在于 apidocs 中。打开 index.html 并搜索您需要的特定 package.class.method

如果不起作用,请尝试手动将 apidoc.zip 复制到 netBeans 的 docs 目录中:
C:\Program Files\NetBeans 7.1.2\java\docs,然后重试。

I had the same problem, and I solved it by removing all URLs and adding only the apidocs.zip downloaded from oracle. After that restart your NetBeans.

Before test whether it works be sure the method you are looking for actually exists within the apidocs. Open index.html and make a search for that particular package.class.method you need.

If it doesn't work, try to manually copy the apidoc.zip to the docs directory of netBeans:
C:\Program Files\NetBeans 7.1.2\java\docs and then retry.

冧九 2024-10-22 18:42:50

在 Netbeans v8.02 中使用 Maven 项目。

首先,通过“项目”窗口查看您的项目;

  • 展开项目的依赖项文件夹
  • 右键单击所需的 *.jar 文件
  • 单击下载 javadoc

完成!

Using a Maven project inside of Netbeans v8.02.

First, view your project via the Projects window;

  • Expand your project's Dependencies folder
  • Right-click the desired *.jar file
  • Click download javadoc

Done!

陌上芳菲 2024-10-22 18:42:50

这对我有用,我手动将 apidoc.zip 复制到 netBeans 的 docs 目录:C:\Program Files\NetBeans 7.1.2\java\docs,然后重新启动我的 netbeans。

This worked for me, I manually copy the apidoc.zip to the docs directory of netBeans: C:\Program Files\NetBeans 7.1.2\java\docs and then restart my netbeans.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文