Java Build Path page
The options in this page indicate the settings for the
Java project properties.
You can reach this page thought
The build class path is a list of paths visible to the
compiler when building the project.
Source tab
Source folders are the root of packages containing .java
files. The compiler will translate the contained files to .class files
that will be written to the output location (see below). Resources existing
in source folders are also copied to the output location unless the setting
in the
Compiler preference page
(Window > Preferences > Java > Compiler > Other) specifies that the resource
is filtered.
You can choose whether to use the project itself as source
folder or to use folders in the project.
Source folder options
Option
|
Description
|
Create New Folder
|
Creates a new folder to contain source
|
Add Existing Folders
|
Allows to add from a list of existing folders
|
Edit
|
Allows to modify the currently selected source folder
|
Remove |
Removes the selected folders from the class path. This does not delete
the folders nor their contents. |
The source folders offered as default by the New Java Project wizard
are configured in the New Project
preference page(Window > Preferences > Java > New Project).
Projects tab
In the Required projects
on the build path list, you can add project dependencies by
selecting other workbench projects to add to the build path for this new
project. TheSelect All and Deselect
All buttons can be used to add or remove all other projects
to or from the build path.
Adding a required project indirectly adds all its classpath
entries marked as 'exported'. Setting a classpath entry as exported is
done in the Order and Export tab.
The projects selected here are automatically added to
the referenced projects list. The referenced project list is used to determine
the build order. A project is always build after all its referenced projects
are built.
Libraries tab
On this page, you can add libraries to the build path.
You can add:
-
Workbench-managed (internal) JAR files
-
File system (external) JAR files
-
Folders containing CLASS files
JAR files can also be added indirectly as class path
variables.
By default, the library list contains an entry representing
the Java runtime library. Typically this is a variable entry called JRE_LIB.
This entry points to the JRE selected as the default JRE. The default JRE
is configured in the
Installed JREs preferences page
(Window > Preferences > Java > Installed JREs)
Libraries tab options
Option
|
Description
|
Add JARs
|
Allows you to navigate the workbench hierarchy and select
JAR files to add to the build path.
|
Add External JARs
|
Allows you to navigate the file system (outside the workbench)
and select JAR files to add to the build path.
|
Add Variable
|
Allows you to add classpath variables to the build path.
Classpath variables are an indirection to JARs with the benefit of avoiding
local file system paths in a classpath. This is needed when projects are
shared in a team.
Variables can be created and edited in the Classpath
Variable preference page (Window > Preferences > Java > Classpath Variables)
|
Advanced |
Opens the Advanced selection dialog. The advanced selection dialog
offers to add class folder and classpath containers. These options are
described in the next section. |
Edit |
Allows you to modify the currently selected library entry. |
Attach Source
|
Allows you to select a source JAR file to attach to the
selected JAR file or classpath variable.
|
Remove
|
Removes the selected element from the build path. This
does not delete the resource.
|
Advanced Selection Dialog
Option
|
Description
|
Create New Class Folder
|
Creates a new class folder for the build path.
|
Add Existing Class Folders
|
Allows you to navigate the workbench hierarchy and select
folders to serve as class containers on the build path.
|
Add Container
|
Allows you add a classpath container. Classpath containers
can stand for an arbitrary number of entries. Typical usages are the representation
of a set of JRE entries. The JRE container is an alternative to the JRE_LIB
classpath entry.
|
Order and Export tab
In the Build classpath
list, you can click the Up and Down
buttons to move the selected path entry up or down in the build path order
for this new project.
Checked list entries are marked as exported. Exported
entries are visible to projects that require the project. Use the Select
All and Deselect All
to change the checked state of all entries. Source folders are always exported,
and can not be deselected.
Build output folder
At the bottom of this page, the
Build output folder
field allows you to enter a path to a folder path where the compilation
output for this project will reside. Use
Browse
to select an existing location from the current project. The default for
this field is configured in the
New
Project preference page (Window > Preferences > Java > New Project).
Build classpath
Classpath variables
Working
with build paths
Attaching source to variables
Attaching source to a JAR file
Frequently asked questions on JDT
Classpath Variables preferences
Java Build Path properties