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:
-
Select a JAR in the Package Explorer and choose Properties > Source Attachment
from the context menu or the File menu
-
Open the Java Build Path page of a project (File > Properties > Java Build
Path). On the library page select a JAR and press Attach
Source
Open an editor on a class file. If the source attachment
has not already been configured for this JAR, the editor contains a button Attach
Source
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.