Java Reference
In-Depth Information
You add global libraries to a project by enabling them for each module that
requires them. Once configured, you'll see each global library listed in the Used
Global Libraries section of your module settings. To include a global library in the
currently selected module, select the check box next to the name. The Edit button
next to the list lets you edit exiting global libraries as well as include new ones.
Adding project libraries
Project libraries have the same look and feel as global libraries but are created at
the project level. Therefore, they're only available to modules in the current
project. If the module exists in more than one project, it doesn't share the project
library in the other project. Available project libraries are shown in the Project
Libraries list; like global libraries, they can be selected and deselected on a per-
module basis.
Adding module libraries
Module libraries are defined within a particular module and are available to that
module only. However, they can be carried with the module from project to
project. Module libraries are anonymous; they aren't given individual names like
global and project libraries, because the list of module libraries is the classpath
for this module, with optional source file and JavaDoc attachments. Module
library entries are often used to include items like resources, property files, and
other non-class file entries into your project. They're also useful when the JAR
files that make up your library are included as part of the module itself rather
than in an external directory.
Use IDEA 's path variables feature (described later in this chapter) to
make it easy to relocate, share, and upgrade libraries. Create a path vari-
able pointing to the root of the library's installation folder; then each
user can create a path variable corresponding to the libraries location on
their machine.
TIP
Specifying search order (modules, classes, libraries)
In some situations, the order of items for the module's classpath may be impor-
tant: for example, when one of your libraries is pulling in an older version of a
class you require, or properties files in a library JAR conflict with one another.
Whatever the situation is, you can use the Order/Export tab, shown in figure 4.16,
to help correct the problem. Use the Move Up and Move Down buttons to reorder
the module's classpath entries appropriately. Notice that in addition to your
 
 
 
 
Search WWH ::




Custom Search