开发者

how to add javaDoc to my Java code in a NetBeans based project?

开发者 https://www.devze.com 2023-02-07 21:28 出处:网络
How can I add JavaDoc orother document to netbeans ? I try with this way : Tools >> Java Platform >> JavaDoc Tab >> JavaDoc.zip (in my desktop)

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 Javad开发者_开发技巧oc 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:

how to add javaDoc to my Java code in a NetBeans based project?


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.


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.


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!)


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.


"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-

  • how to add javaDoc to my Java code in a NetBeans based project?

Step 3-

  • how to add javaDoc to my Java code in a NetBeans based project?

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


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.


this help me:

http://wiki.netbeans.org/FaqJavaDoc#Adding_the_JDK_Javadoc_to_the_NetBeans_IDE

try it, maybe help


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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消