You can attach source to JAR file to enable source-level stepping and browsing of classes contained in a binary JAR file. Follow these steps to attach source to a JAR file:
1. |
Select the project, and from its context menu, select Properties. |
2. |
In the Properties dialog, select the Java Build Path page. |
3. |
Click the Libraries tab. |
4. |
Select the JAR file to which you want to attach source. |
5. |
Click the Attach Source button to bring up the source attachment dialog. |
6. |
In the Attachments dialog, you can associate the JAR file with another archive (either a JAR or a ZIP file). In the Archive field, type or browse to select a file containing source code for the JAR file. The source archive can be either in the workbench or in the file system. |
7. |
In the Root Path field, type or browse to select the prefix path to the source code stored inside the archive. If you click Browse, you can browse the contents of the JAR and select its root. Specifying the proper root path is critical to locating the source for a type. A common prefix is src. For example, when looking for the source of java.lang.Object, then you would browse to src/java/lang/Object.java (i.e., src is the prefix). |
8. |
Click OK when you are done. |