| <!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"> |
| |
| <title>Source attachments</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>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> |
| (<a class="command-link" href='javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.jdt.debug.ui.preferences.VMPreferencePage)")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png"> |
| <span class="control">Java > Installed JREs</span></a>). |
| Go to this preference page to configure the source attachment for the JRE's library..</p> |
| |
| |
| |
| <p><img src="../images/ngrelc.png" alt="Related concepts" border="0" ></p> |
| <p> |
| <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/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></p> |
| <p> |
| <img src="../images/ngrelr.png" alt="Related reference" border="0" > |
| </p> |
| <p> |
| <a href="../reference/ref-19.htm">Installed JREs preferences</a><br> |
| <a href="../reference/ref-123.htm">Java Build Path properties</a><br> |
| </p> |
| |
| |
| </body> |
| </html> |
| |