blob: 268fcadbef3a37ce4ceafc2185a5c207ec4b8a87 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. 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">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
<title>
Adding a classpath variable to the build path
</title>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
</head>
<body>
<h1>
Adding a classpath variable to the build path
</h1>
<p>
To add a classpath variable to the Java build path of a project, follow these steps:
</p>
<ol>
<li>
Select the project to which you want to add the classpath&nbsp;variable
</li>
<li>
From the project's pop-up menu, select <strong>Properties</strong><br>
</li>
<li>
In the Properties page, select the <strong>Java Build Path</strong> page.
</li>
<li>
On the <strong>Libraries</strong> tab, click <strong>Add Variable</strong> for adding a variable that refers to a JAR file.<br>
The <strong>New Variable Classpath Entry</strong> dialog appears which shows all available classpath variables.
<p><img src="../images/classpathVar.png" alt="Classpath variable dialog"></p>
</li>
<li>
Select a classpath variable then press <strong>OK</strong>.
<ul>
<li>
If the variable resolves to a folder, you can specify a path extension that points to a JAR.
To do this press the <strong>Extend...</strong> button. </li>
<li>Press <strong>Edit...</strong> to create a new classpath variable or edit an existing one.
</li>
</ul>
</li>
</ol>
<p>
<strong>Hint</strong>: You can add multiple variable entries at once to the Java build path:
Select more than one variable in the <strong>New Variable Classpath
Entry</strong> dialog, or multiple JAR files in the <strong>Variable Extension</strong> dialog.<br>
</p>
<img src="../images/ngrelc.png" alt="Related concepts" border="0" >
<p>
<a href="../concepts/cclsspthv.htm">Classpath variables</a><br>
<a href="../concepts/cbuildcp.htm">Build classpath</a>
</p>
<p>
<img src="../images/ngrelt.png" alt="Related tasks" border="0" >
</p>
<p>
<a href="tasks-116.htm">Attaching source to a class path variable</a><br>
<a href="tasks-11.htm">Creating Java elements</a><br>
<a href="tasks-117.htm">Defining a class path variable</a><br>
<a href="tasks-118.htm">Deleting a class path variable</a><br>
<a href="tasks-111.htm">Viewing and editing a project's build path</a>
</p>
<p>
<img src="../images/ngrelr.png" alt="Related reference" border="0" ><br>
<a href="../reference/ref-15.htm">Classpath Variables preference page</a><br>
<a href="../reference/ref-123.htm">Build path properties page</a><br>
&nbsp;
</p>
</body>
</html>