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

Page:    1 2 3 >

By default, EclipseSW doesn't use the JDKW JRE. So, let's say you have a JavaSW class such as the following Test class.

Test class

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:

Source not found

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.

Finding JDK JRE

Eclipse should find the JRE within your JDK directory, as in the example below. Check the JDK JRE checkbox and click OK.

Selecting JDK JRE

(Continued on page 2)

Page:    1 2 3 >