If you use Eclipse, here is how you can link to Java source files:
- As Thorbjørn Ravn Andersen mentioned, download the JDK source http://download.java.net/jdk6/source/ , and unzip the tar.gz file to a folder, say 'jdk.src';
- Open your java file that refers to a base java class (say Thread) that comes from the JDK;
- Tap F3 to open declaration, expect Eclipse to open a new tab with "source not found" message. It asks for the rt.jar source location, but you don't need to go through the trouble of compiling the JDK source to get it. Instead, click on the "attach source" button, in the "source attachment configuration" popup window, select "External Folder", then point to jdk.src/jdk/src/share/classes directory. Eclipse will then automatically load the newly found JDK class source code in the same window.