blob: f164bebc6923c28404780cc261fb75491ec8d1c8 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2012. 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 Attachment Property 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" type="text/javascript"> </script>
</head>
<body>
<h1>Source Attachment Property Page</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 the decompiled code.
Setting the source attachment also allows source level stepping with the debugger.</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 &gt; 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 &gt;
Properties &gt; 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>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">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>
For a source attachment in an external location you can also specify an optional <b>Encoding</b> for reading the source attachment. By default the workspace encoding is used.
<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="../reference/preferences/java/debug/ref-installed_jres.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.svg" alt="Opens the Installed JRE preference page">
<span class="control">Java &gt; Installed JREs</span></a>).
Go to this preference page to configure the source attachment for the JRE's library..</p>
<h3 class="related">Related concepts</h3>
<a href="../concepts/concept-build-classpath.htm">Build classpath</a>
<h3 class="related">Related references</h3>
<a href="../reference/preferences/java/debug/ref-installed_jres.htm">Installed JREs preferences</a><br>
<a href="../reference/ref-properties-build-path.htm">Java build path properties</a>
</body>
</html>