Java Reference
In-Depth Information
Figure 4.17
The Path Variables configuration
window lets you define variables
that make your project and
module files more portable.
Using path variables to facilitate shared projects
Path variables are particularly useful when you're working with third-party librar-
ies. For example, if your project uses the JDOM XML libraries, stored on your
machine as C:\libs\jdom-1.0.0 , all references to files below the root folder (its
classes, sources, and JavaDocs) can instead be derived from the logical folder
$ JDOM _ HOME $. Then, users of the project can define the actual location of the
JDOM home directory on their own workstation, allowing IDEA to resolve the
path correctly.
Creating and editing path variables
You manage your collection of path variables, and create new ones, through the
Path Variables section of the IDE Settings . A typical example is shown in
figure 4.17. In this example, we've configured copies of home folders for third-
party libraries as well as our application server and Java Servlet SDK . Using this
settings panel, you can add, edit, and remove path variables at any time. When
you add a path variable's value, you're asked to select the directory value using
the directory requestor—you can't edit the values by hand. This ensures that vari-
ables resolve to actual directories.
Using path variables in your project
IDEA automatically uses any path variables
you've defined in your setup, replacing cor-
responding path references in your projects
and modules with the path variable refer-
ence. Note that if you're sharing your
project with other developers, you've now
required them to define the path variables
as well. Otherwise, IDEA won't know how to
resolve the path correctly, in which case the
path (with the path variable visible) will be
Figure 4.18 Adding a new path variable
is as simple as specifying a name and
choosing a path.
 
 
 
 
Search WWH ::




Custom Search