| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
| <meta http-equiv="Content-Style-Type" content="text/css"> | |
| <title>Source Attachments</title> | |
| <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> | |
| </head> | |
| <body> | |
| <h1>Source attachments</h1> | |
| <p>To browse the source of a type contained in library you can attach a source archive or source folder to this library. The editor will then show the source instead of a the decompiled code. | |
| Having the source attachment set the debugger can offer source level stepping in this type.</p> | |
| <p>The Source Attachment dialog can be reached in several ways:</p> | |
| <ul> | |
| <li>Select a JAR in the Package Explorer and choose <b>Properties > Java Source Attachment</b> from the context | |
| menu or the <a href="ref-menu-project.htm">Project menu</a></li> | |
| <li>Open the Java Build Path page of a project (<b>Projects > | |
| Properties > Java Build Path</b>). On the <b>Libraries</b> page expand the library's node and select the <b>Source | |
| attachment</b> attribute and press <b>Edit</b></li> | |
| <li><span class="control"></span>Open an editor on a class file. If the | |
| source attachment has not already been configured for this JAR, the | |
| editor contains a button <span class="control">Attach Source</span></li> | |
| </ul> | |
| <p>Depending of how a JAR was contributed to the classpath, you can see different types of Source attachment dialogs:</p> | |
| <h2>JAR</h2> | |
| <p>In the <span class="control">Location path</span> field, enter the path of an archive or a folder containing the source. Use either the <b>Workspace</b>, <b>External | |
| File</b> or the <b>External Folder</b> button to browse for a location.</p> | |
| <h2>Variable</h2> | |
| <p>In the <span class="control">Location Variable Path</span> field | |
| enter a <i>variable path</i> that points to the source attachment's location. | |
| A variable path has as first segment a variable (which will resolve to a | |
| folder or file), the rest is an optional path extension (e.g.<em>MYVARIABLE/src.jar</em> | |
| ). Use either the <span class="control">Variable</span> button to select | |
| an existing variable and the <span class="control">Extension</span> | |
| button to select the extension path. The <span class="control">Extension</span> | |
| button is only enabled when the variable can be extended (resolves to a | |
| folder)</p> | |
| <p><var>JRE_SRC</var> is a reserved variable that points to a JRE selected in the <a href="ref-19.htm">Installed JREs preference page</a> (<span | |
| class="control">Window > Preferences > Java > Installed JREs</span>). Go to this preference page to configure the source attachment for the JRE's library..</p> | |
| <p><img src="../images/ngrelc.gif" alt="Related concepts" border="0" height="27" width="159"><br> | |
| <a href="../concepts/cbuildcp.htm">Build classpath</a></p> | |
| <p><img src="../images/ngrelt.gif" alt="Related tasks" border="0" height="27" width="159"><br> | |
| <a href="../tasks/tasks-110.htm">Working with build paths</a><br> | |
| <a href="../tasks/tasks-116.htm">Attaching source to variables</a><br> | |
| <a href="../tasks/tasks-115.htm">Attaching source to a JAR file</a><br> | |
| <a href="../reference/ref-19.htm">Installed JREs preferences</a><br> | |
| <a href="../reference/ref-123.htm">Java Build Path properties</a><br> | |
| </p> | |
| <p><a href="../hglegal2003.htm"><img src="../images/ngibmcpy2003.gif" alt="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved." border="0" height="14" width= | |
| "324"></a></p> | |
| </body> | |
| </html> | |