How do I view and debug JDK source code in Eclipse?
Author: Deron Eriksson
Description: This Java tutorial describes how to debug through Java Development Kit source code in Eclipse.
Tutorial created using: Windows XP || JDK 1.5.0_09 || Eclipse Web Tools Platform 1.5.1
If you click on 'String' and click F3, Eclipse will try to jump to the String class. However, since no source code is attached to the JRE, we see the following:
So, let's switch our Eclipse to use the JDK JRE. Go to Window → Preferences → Java → Installed JREs. This will list the JREs that Eclipse knows about. If the JDK JRE isn't there, click on the Search... button, which brings up the Directory Selection window, where you can select your JDK directory. Click OK to perform the search for the JRE in the JDK directory.
Eclipse should find the JRE within your JDK directory, as in the example below. Check the JDK JRE checkbox and click OK.
(Continued on page 2)