| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| |
| <html> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| |
| <title>Java Build Path page</title> |
| <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script> |
| </head> |
| |
| <body> |
| <h1>Java Build Path page</h1> |
| |
| <p>The options in this page indicate the build path settings for a Java project. |
| You can reach this page through the <a href="ref-121.htm">New Java Project wizard</a>.</p> |
| |
| <p>The build class path is a list of paths visible to the compiler when building the project.</p> |
| |
| <h2>Source tab</h2> |
| |
| <p>Source folders are top-level folders in the project hierarchy. They 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 folder.</p> |
| <p>Source folders allow to structure the project, for example to separate |
| test from the application in two source folders. Within a source folder, a more detailed structuring can be acived by using packages.</p> |
| <p>Each source folder can define an exclusion filter to specify which |
| resources inside the folder should not be visible to the compiler.</p> |
| <p>Resources existing in source folders are copied to the output folder unless the setting in the <a href="preferences/java/compiler/ref-preferences-building.htm">Java > Compiler > Building</a> preference |
| page specifies that the resource is filtered. The output folder is defined per project except if a source folder specifies its own output folder.</p> |
| |
| <p>The tree shows the project as it will look like when switching to the package explorer. Several operations can be executed |
| on this tree to change the structure of the project.</p> |
| |
| <table border="1" cellspacing="0" cellpadding= "5" summary="Source folder options" width="600"> |
| |
| <tbody> |
| <tr> |
| <th>Icon</th> |
| |
| <th>Option</th> |
| |
| <th>Description</th> |
| </tr> |
| |
| <tr> |
| <td align="center" valign="middle" width="5%"><img src="../images/org.eclipse.jdt.ui/elcl16/add_to_buildpath.gif" alt="Add to build path" border="0" ></td> |
| |
| <td align="center" valign="middle" width="20%">Add source folder</td> |
| |
| <td align="left" valign="top">Add a folder to the Java build path as source folder.</td> |
| </tr> |
| |
| <tr> |
| <td align="center" valign="middle" width="05%"><img src="../images/org.eclipse.jdt.ui/elcl16/add_linked_source_to_buildpath.gif" alt="Link additional source to project" border="0" ></td> |
| |
| <td align="center" valign="middle" width="20%">Link additional source to project</td> |
| |
| <td align="left" valign="top">Add a link to a folder in the file system as source folder to the Java build path. |
| </td> |
| </tr> |
| |
| <tr> |
| <td align="center" valign="middle" width="05%"><img src="../images/org.eclipse.jdt.ui/elcl16/remove_from_buildpath.gif" alt="Remove from buildpath" border="0" ></td> |
| |
| <td align="center" valign="middle" width="20%">Remove from buildpath</td> |
| |
| <td align="left" valign="top">Remove a source folder from the Java build path and change it into a normal folder.</td> |
| </tr> |
| |
| <tr> |
| <td align="center" valign="middle" width="05%"><img src="../images/org.eclipse.jdt.ui/elcl16/exclusion_filter_attrib.png" alt="Exclude" border="0" ></td> |
| |
| <td align="center" valign="middle" width="20%">Exclude</td> |
| |
| <td align="left" valign="top">Add a resource to the exclusion filter of it's parent source folder. |
| The excluded resource and all its children are no longer visible to the compiler. |
| </td> |
| </tr> |
| |
| <tr> |
| <td align="center" valign="middle" width="05%"><img src="../images/org.eclipse.jdt.ui/elcl16/inclusion_filter_attrib.png" alt="Include" border="0" ></td> |
| |
| <td align="center" valign="middle" width="20%">Include</td> |
| |
| <td align="left" valign="top">Includes a previously excluded resource.</td> |
| |
| </tr> |
| |
| <tr> |
| <td align="center" valign="middle" width="05%"><img src="../images/org.eclipse.jdt.ui/obj16/configure_buildpath.gif" alt="Configure source folder properties" border="0" ></td> |
| |
| <td align="center" valign="middle" width="20%">Configure source folder properties</td> |
| |
| <td align="left" valign="top"><p>The edit source folder property menu has two actions</p> |
| <ol> |
| <li><strong>Configure Inclusion / Exclusions Filters</strong>: Customize the inclusion and exclusion filters by defining string patterns. |
| It is possible to use wildcard in patters (i.e. to exclude all java files which |
| start with "Test" write "Test*.java").</li> |
| <li><strong>Configure Output Folder</strong>: Change the output folder for a source folder. This action is only enabled if |
| <strong>Allow output folders for source folders</strong> is enabled.</li> |
| </ol></td> |
| </tr> |
| |
| <tr> |
| <td align="center" valign="middle" width="05%"><img src="../images/org.eclipse.jdt.ui/elcl16/clear_co.png" alt="Undo all changes" border="0" ></td> |
| |
| <td align="center" valign="middle" width="20%">Undo all changes</td> |
| |
| <td align="left" valign="top">All changes that have been applied to the project in this wizard will be withdrawn and the original |
| state of the project is reconstructed. |
| </td> |
| </tr> |
| |
| <tr> |
| <td align="center" valign="middle" width="05%"> </td> |
| |
| <td align="center" valign="middle" width="20%">Allow output folders for source folders</td> |
| |
| <td align="left" valign="top">If enabled, each source folder can have its own output folder. Otherwise all source folders will use the |
| default output folder.</td> |
| </tr> |
| </tbody> |
| </table> |
| |
| <p>A shorter description of all operations is visible in the <strong>Details</strong> pane below the project tree.</p> |
| |
| <!-- ================================================================================ --> |
| <!-- Keep in sync with ref-123.htm --> |
| |
| <h2>Projects tab</h2> |
| |
| <p>In the <b>Required projects on the build path</b> list, you can add project dependencies by selecting other workbench |
| projects to add to the build path for this new project.</p> |
| |
| <p>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.</p> |
| |
| <p>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.</p> |
| |
| <table border="1" cellspacing="0" cellpadding= "5" summary="Source folder options" width="600"> |
| |
| <tbody> |
| <tr> |
| <th>Action</th> |
| |
| <th>Description</th> |
| </tr> |
| |
| <tr> |
| <td align="center" valign="middle" width="20%">Add</td> |
| |
| <td align="left" valign="top">Add another project in the workspace to the build path of this project.</td> |
| </tr> |
| |
| <tr> |
| <td align="center" valign="middle" width="20%">Edit</td> |
| |
| <td align="left" valign="top">Edit the classpath attribute of a required project.</td> |
| </tr> |
| |
| <tr> |
| <td align="center" valign="middle" width="20%">Remove</td> |
| |
| <td align="left" valign="top">Removes the selected required projects from the list.</td> |
| </tr> |
| |
| </tbody> |
| </table> |
| |
| |
| <h2>Libraries tab</h2> |
| |
| <p>On this page, you can add libraries to the build path.</p> |
| <p>By default, the library list contains an entry representing the Java runtime library. This entry points to the JRE |
| selected as the default JRE. The default JRE is configured in the <a href="preferences/java/debug/ref-installed_jres.htm">Java > Debug > Installed JREs</a> preferences page.</p> |
| |
| <table border="1" cellspacing="0" cellpadding= "5" summary="libraries tab options" width="600"> |
| <caption> |
| Libraries tab options<br> |
| </caption> |
| |
| <tbody> |
| <tr> |
| <th width="20%">Option</th> |
| |
| <th>Description</th> |
| </tr> |
| |
| <tr> |
| <td align="left" valign="top">Add JARs</td> |
| |
| <td align="left" valign="top">Allows you to navigate the workbench hierarchy and select JAR files to add to the build path.</td> |
| </tr> |
| |
| <tr> |
| <td align="left" valign="top">Add External JARs</td> |
| |
| <td align="left" valign="top">Allows you to navigate the file system (outside the workbench) and select JAR files to add to the build path.</td> |
| </tr> |
| |
| <tr> |
| <td align="left" valign="top">Add Variable</td> |
| |
| <td align="left" valign="top">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.<br> |
| Variables can be created and edited in the <a href="ref-15.htm">Java > Build Path > Classpath Variables</a> preference page.</td> |
| </tr> |
| |
| <tr> |
| <td>Add Library</td> |
| |
| <td>Allows to add a predefined libraries like the JRE System Library. Such libraries can stand for an arbitrary number of entries (visible as children node of the library node)</td> |
| </tr> |
| |
| <tr> |
| <td>Add Class Folder</td> |
| |
| <td>Allows to navigate the workbench hierarchy and select a class folder for the build path. The selection dialog also allows you to create a new folder.</td> |
| </tr> |
| |
| <tr> |
| <td align="left" valign="top">Edit</td> |
| |
| <td align="left" valign="top">Allows you to modify the currently selected library entry or entry attribute</td> |
| </tr> |
| |
| <tr> |
| <td align="left" valign="top">Remove</td> |
| |
| <td align="left" valign="top">Removes the selected element from the build path. This does not delete the resource.</td> |
| </tr> |
| |
| <tr> |
| <td align="left" valign="top">Migrate Jar</td> |
| |
| <td align="left" valign="top">Migrate a jar on the build path to a newer version. If the newer version contains refactoring scripts |
| the refactoring stored in the script will be executed.</td> |
| </tr> |
| </tbody> |
| </table> |
| |
| <p> Libraries have the following attributes (presented as library entry children nodes):</p> |
| |
| <table border="1" cellspacing="0" cellpadding="5" summary="Source folder options" |
| width="600"> |
| <caption>Library entry attributes<br> |
| </caption> |
| |
| <tbody> |
| <tr> |
| <th>Attribute</th> |
| |
| <th>Description</th> |
| </tr> |
| |
| <tr> |
| <td align="left" valign="top" width="20%">Javadoc location</td> |
| |
| <td align="left" valign="top">Specifies where the library's Javadoc documentation can be found. If specified you can use <b>Shift+F2</b> on an element of this library to open its documentation.</td> |
| </tr> |
| |
| <tr> |
| <td align="left" valign="top">Source attachment</td> |
| |
| <td align="left" valign="top">Specifies where the library's source can be found.</td> |
| </tr> |
| |
| <tr> |
| <td align="left" valign="top">Native library location</td> |
| |
| <td align="left" valign="top">Specifies where native library required for the library to operate can be found.</td> |
| </tr> |
| |
| <tr> |
| <td align="left" valign="top">Access rules</td> |
| |
| <td align="left" valign="top">Specifies access rules for resources contained in the library. This allows to hide content of a library.</td> |
| </tr> |
| </tbody> |
| </table> |
| |
| |
| |
| |
| <h2>Order and Export tab</h2> |
| |
| <p>In the <b>Build class path order</b> list, you can click the <b>Up</b> and <b>Down</b> buttons to move the selected path entry up or down in the build path order for this new project.</p> |
| |
| <p>Checked list entries are marked as exported. Exported entries are visible to projects that require the project. Use the <b>Select |
| All</b> and <b>Deselect All</b> to change the checked state of all entries. Source folders are always exported, |
| and can not be deselected.</p> |
| |
| <p><img src="../images/ngrelc.png" alt="Related concepts" border="0" ></p> |
| <p> |
| <a href="../concepts/cbuildcp.htm">Build classpath</a><br> |
| <a href="../concepts/cclsspthv.htm">Classpath variables</a><br> |
| </p> |
| <p> |
| <img src="../images/ngrelr.png" alt="Related reference" border="0" > |
| </p> |
| <p> |
| <a href="../reference/ref-152.htm">Frequently asked questions on JDT</a><br> |
| <a href="../reference/ref-15.htm">Classpath Variables preferences</a><br> |
| <a href="../reference/ref-properties-compiler.htm">Java Compiler properties</a> |
| </p> |
| |
| |
| </body> |
| </html> |
| |
| |