blob: 2d80431a20489d4d29d608b554e73866cc84780d [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>
Attaching source to a JAR file
</title>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
</head>
<body>
<h1>
Attaching source to a JAR file
</h1>
<p>
You can attach source to a JAR file to enable source-level stepping and browsing of classes contained in a binary JAR file.
Unless its source code is attached to a JAR file
in the workbench, you will not be able to view the source for the JAR file.
</p>
<p>
To attach source to a JAR file:
</p>
<ol>
<li>
Select the project, and from its pop-up menu, select <strong>Properties</strong>.<br>
In the Properties dialog, select the Java Build Path page.
</li>
<li>
On the <strong>Libraries</strong> tab, select the JAR file to which you want to attach source.<br>
Expand the node by clicking on the plus and select the node <em>Source Attachment</em>.
Click the <strong>Edit </strong> button to bring up the source attachment dialog.
</li>
<li>
Fill in the <strong>Location path</strong> field depending on the location, choose between the workspace, an external file or external folder.
</li>
<li>
Click <strong>OK</strong>.
</li>
</ol>
<p>
or
</p>
<ol>
<li>
Select the JAR file in the Package Explorer, and from its pop-up menu, select <strong>Properties</strong>.<br>
In the Properties dialog, select the <strong>Java Source Attachment</strong> page.
</li>
<li>
Fill in the <strong>Location path</strong> field depending on the location, choose between the workspace, an external file or external folder.
</li>
<li>
Click <strong>OK</strong> .
</li>
</ol>
<img src="../images/ngrelc.png" alt="Related concepts" border="0" >
<p>
<a href="../concepts/concepts-1.htm">Java development tools (JDT)</a>
</p>
<p>
<img src="../images/ngrelt.png" alt="Related tasks" border="0" >
</p>
<p>
<a href="tasks-116.htm">Attaching source to variables</a><br>
<a href="tasks-33.htm">Creating a new JAR file</a><br>
<a href="tasks-136.htm">Stepping through the execution of a program</a>
</p>
<p>
<img src="../images/ngrelr.png" alt="Related reference" border="0" ><br>
<a href="../reference/ref-123.htm">Java Build Path</a><br>
<a href="../reference/ref-124.htm">Source Attachment dialog</a><br>
&nbsp;
</p>
</body>
</html>