FaqJavaDoc

Contents


Adding the JDK Javadoc to the NetBeans IDE

Problem: "No javadoc found" displays in the Editor popup window, how do I install documentation?

Solution: Download and install the "Java SE Documentation" files from the Oracle Technology Network.

  1. Download documentation for your Java platform (either JDK 5.0, JDK 6, or JDK 7)
  2. Save the file, you do not need to unzip it.
  3. In the NetBeans IDE, go to "Tools > Java Platforms".
  4. Select the platform that you use, and click the Javadoc tab.
  5. Click "Add ZIP/Folder" and browse to where you saved the file, e.g. jdk-6u23-docs.zip, then click "Add ZIP/Folder".
  6. Close the Java Platform Manager.

The JavaDoc popup should now work and display more information on the usage of a command.

For JDKs where the Javadoc (src.zip) is on standard place, the NetBeans IDE detects it by default when you add a new platform.

The NetBeans IDE 7.0 supports the URL of the existing online JDK Javadoc.
The JDK Javadoc is preconfigured with URL pointing to a proper online Javadoc (e.g., http://download.oracle.com/javase/7/docs/api/ for JDK 7).

MacOS Platform Specific Info

The Mac OS X JDK installer puts the JDK into the default /Library/Java/JavaVirtualMachines/ folder.

The latest JDK on Mac OS X 10.6 is /Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk.

Below is the list of paths to Javadoc files on the Mac OS X operating system:

  • /Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home/docs.jar - Javadoc
  • /Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home/appledocs.jar - Javadoc for Apple specific classes

The NetBeans IDE 7.0 correctly detects the Javadoc files when you add the JDK (/Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk) to the Platform Manager.

Adding Javadoc to a Project

Problem: A NetBeans update breaks the "show javadoc" links, how do I point the NetBeans to the jar itself?

Solution: Add the existing Javadoc either via the Library Manager or the Project Properties.

Adding Javadoc via the Library Manager

  1. In the NetBeans IDE, go to "Tools > Libraries".
  2. In the Library Manager, choose the Javadoc tab.
  3. Click "Add ZIP/Folder" and browse to where your project Javadoc is located.
  4. Specify the Javadoc ZIP or folder and click "Add ZIP/Folder".
  5. Click "OK" to close the Library Manager.

Adding Javadoc via the Project Properties

  1. In NetBeans IDE, right-click the project and choose Properties from the popup menu.
  2. In the Category list, select Libraries.
  3. In the Compile tab, click the "Add ZIP/Folder" button and browse to where your project Javadoc is located.
  4. Specify the Javadoc ZIP or folder and click "Open".
  5. Click "OK" to close the Project Properties dialog box.

In case you added a plain Jar/Folder that does not contain a Javadoc, you need to click "Edit" and, in the Edit Jar Reference dialog box, browse for the Javadoc to attach it.
After you specify the location of the Javadoc, click "Open" to close the Select JAR/folder dialog box, click "OK" to close the Edit Jar Reference dialog box, and click "OK" to close the Propect Properties dialog box.

Adding Javadoc for NetBeans Platform Modules

Only relevant for Ant-based Platform development; Maven-based projects use Maven's standard method of Javadoc association.

Official Online Documentation

Under Tools > NetBeans Platforms, select a platform. If it does not already have defaulted official Javadoc - for example http://bits.netbeans.org/6.9/javadoc/ - and you have have a downloaded platform Javadoc ZIP available (containing Javadoc for all API modules), you may add it here.

Installing from Plugin Manager

The module "NetBeans API Documentation" in Plugin Manager installs the latest released Javadoc for the the "default platform". This is available for browsing offline.

Standalone Cluster

If you added an "External Cluster" to an Ant-based suite project, you would be prompted to supply Javadoc for the cluster in that dialog; the "Edit" button in the suite's Libraries tab permits it to be added later.

Ad-Hoc

To associate Javadoc with a third-party library JAR wrapped in a module, simply go to Tools > Libraries and create a library pointing to the same JAR (with whatever library name you like) and edit its Javadoc.

Note that the JAR referred to from the library definition must match the location of the JAR in the library wrapper module's sources, typically under release/modules/ext.

Viewing the Added Javadoc

Below is the list of different ways to view the added Javadoc in the NetBeans IDE.

NetBeans IDE Main Menu

  • In the NetBeans IDE main menu, choose "Source > Show Documentation".
  • In the NetBeans IDE main menu, choose "Window > Other > Javadoc".
  • In the NetBeans IDE main menu, choose "Help > Javadoc Index Search".

Key Combinations

  • Ctrl-Shift-Space
  • Shift-F1

Please note that apart from the listed above ways to view the Javadoc there exist several NetBeans IDE features like Navigator, Code Completion, Inspect Members, Inspect Hierarchy which show the Javadoc.

Troubleshooting

The NetBeans IDE reports a warning when you attempt to add invalid source roots and Javadoc roots (e.g., if there is neither source nor Javadoc inside).

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo