如何将 javaDoc 添加到基于 NetBeans 的项目中的 Java 代码?
如何将 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:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
在 NetBeans IDE 中尝试此操作
希望这有帮助。
try this in NetBeans IDE
Hope this helps.
如果您在项目中使用 Maven,请按照以下步骤为您附加的库附加 Java 文档。
如果您想为特定库添加 javadoc,请按照 Himanshu Soni 建议的选项进行操作。
If you are using maven in your project then follow below steps to attach Java docs for your attached libraries.
and If you want to add javadoc for particular library then follow the options as suggested by Himanshu Soni.
通常,您不能将 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!)
你遵循了非常正确的程序,在我写这个答案之前我就已经抛出了这个问题,至于这是当你谷歌这个问题时出现的第一个结果,我想很多人会发现它很方便并节省时间,解决方案是:
解压缩您所引用的 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.
“工具>>Java平台>>JavaDoc选项卡>>JavaDoc.zip”
上述步骤的问题可以通过沿着内容面板中已添加的两条路径向下移动来轻松解决如下所示。
第 1 步-
并添加您要添加的 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-
and Add ZIP/Folder you want to add.
Step 2-
Step 3-
That's all and if zip file doesn't works the extract first and then add it.
我遇到了同样的问题,我通过删除所有 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 particularpackage.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.
这对我有帮助:
http://wiki.netbeans.org/FaqJavaDoc#Adding_the_JDK_Javadoc_to_the_NetBeans_IDE
尝试一下,也许帮助
this help me:
http://wiki.netbeans.org/FaqJavaDoc#Adding_the_JDK_Javadoc_to_the_NetBeans_IDE
try it, maybe help
在 Netbeans v8.02 中使用 Maven 项目。
首先,通过“项目”窗口查看您的项目;
完成!
Using a Maven project inside of Netbeans v8.02.
First, view your project via the Projects window;
Done!
这对我有用,我手动将 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.