Making External Sources and Javadoc Available in the IDE


You might want to associate documentation and source with classes your project depends on. This is useful if you want to do any of the following:

  • As you are debugging, see the source when stepping into a class your project depends on.

  • Jump to the source of a referenced class from the Source Editor (Alt-O).

  • Jump to the Javadoc documentation of a source file from within the IDE (Alt-F1).

The IDE has a Library Manager feature that enables you to declare these associations, which you can then take advantage of for all your projects.

To create a library:

  1. Choose Tools | Library Manager and then click the New Library button.

  2. In the New Library dialog box, type a display name for the library and click OK.

  3. In the Class Libraries list, select the new library.

  4. Select the Classpath tab and click Add JAR/Folder. Then select the JAR file or the folder that contains the classes and click Add JAR/Folder.

  5. If you want to associate sources with the library, select the Sources tab and click Add JAR/Folder. Then select the JAR file or the folder that contains the sources and click Add JAR/Folder.

  6. If you want to associate Javadoc documentation with the library, select the Javadoc tab and click Add ZIP/Folder. Then select the JAR file or the folder that contains the documentation and click Add ZIP/Folder.

  7. Click OK to close the Library Manager.

To add a library to your project:

  1. Expand the project's node in the Projects window.

  2. Right-click the project's Libraries node and choose Add Library.

When a library with a JAR file, sources, and documentation is designated in the Library Manager, the IDE recognizes the association of those elements even if you only add the JAR file to your project.

If the library you have designated consists of more than one JAR file, the other JARs are not duplicated on the classpath if you have added them to the classpath individually.




NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net