Selecting Packages and Libraries
See Also
By default, the Object Browser only displays the packages and libraries that can be referenced from the current solution, which include all packages in the solution, the packages installed by the Java Package Manager (JPM), and the packages on the classpath. You can also add additional packages and libraries to the Object Browser.
To select the packages and libraries to be browsed
-
Right-click the Object Browser and click Select Current Packages/Libraries on the shortcut menu. You can also click the Select Current Packages/Libraries button on the Object Browser's command bar.
-
The Select Packages/Libraries dialog box shows the packages and libraries that are available for browsing. The Solution node lists the Java projects that belong to your solution. The Other Libraries and Packages node contains the following subnodes:
-
COM Libraries, which lists all COM components and type libraries that are available for browsing.
-
Java Installed Packages, which lists all packages that are on the classpath or have been installed by the JPM.
-
Other Java Packages, which lists other packages that are available for browsing but are not on the classpath and have not been installed by the JPM.
-
Select the packages and libraries that you want displayed in the Object Browser, and clear the items that you want removed. A package or library will be displayed in the Object Browser only if all of its parent nodes are also selected. (By default, selecting an item automatically selects all parent nodes.) A node that is selected with a gray checkmark indicates that some—but not all—of its child items are selected.
Tip The easiest way to identify which packages and libraries will be displayed in the Object Browser is that these items appear in bold.
-
To add items to the COM Libraries and Other Java Packages nodes, click Add.
-
To add COM components and libraries, click the COM Libraries tab in the Add New Packages/Libraries dialog box. All components and libraries that are currently registered on your computer are listed. (To register another component or library and add it to the list, click Browse to locate the file.) Select the components and libraries you want to add and click OK.
-
To add other Java packages, click the Other Java Packages tab in the Add New Packages/Libraries dialog box. Click Browse to locate the file containing the package. After the package has been added to the list, click OK.
Important Adding COM components or other Java packages to the Object Browser simply allows you to browse the components or packages. To actually use a COM component in your project, you must import it. For information on how to do this, see Importing COM Objects.
To use a Java package from your project, you must add it to the classpath. For information about the classpath, see CLASSPATH Environment Variable and Setting the Classpath.
-
Click OK to apply your selections.
The items that you select for browsing in the Select Packages/Libraries dialog box may persist after you close the Object Browser:
-
The packages and libraries that you select under the Other Libraries and Packages node will persist per user, per computer. For example, if you create a new solution on the same computer, the same selected set of packages and libraries under Other Libraries and Packages will be displayed by the Object Browser. However, if another user logs onto the computer, a different set of packages and libraries may be initially selected.
-
The projects that you select under the Solution node will not persist after you close the solution. The next time you reopen the solution, all Java projects in the solution will be selected by default.