Source attachments

To browse the source of a type contained in a binary JAR you can attach a source archive to this JAR. 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.
 
The Source Attachment dialog can be reached in several ways:
To configure the source attachment the location of an archive that contains source files has to set and archive's root path has to be specified. Specifying the proper root path is critical to locating the source for a type. For example, when the Java development tools are looking for the source for java.lang.Object and the Object.java file is located in the archive under src/java/lang/Object.java, then src is the prefix.
 
Depending of how a JAR was contributed to the classpath, you can see different types of Source attachment dialogs:

JAR

Variable

JRE_SRC and JRE_SRCROOT are reserved variables that point to a JRE selected in the Installed JREs preference page (Window > Preferences > Java > Installed JREs). Go to this preference page to configure the source attachment for the JRE's library..

Container

Source attachments coming from container entries have to be configured on the container's configuration page. For the JRE container this is the Installed JREs preference page (Window > Preferences > Java > Installed JREs).

 

Related concepts

Build classpath

Related tasks

Working with build paths

Attaching source to variables
Attaching source to a JAR file

 

Related reference

Installed JREs preferences
Java Build Path properties

Copyright IBM Corporation 2000, 2002. All Rights Reserved.