1, first, in the installation of the JDK to install the source code, perhaps you did not notice, in fact, the source code is in our JDK installation directory below. (when installed, you can choose the source code installation path, if you choose a different path will not be under the JDK, the default is under the JDK.) )
2. Open Eclipse, click "Window", "Preferences", "Java", "Installed JREs"
At this point the "Installed JREs" Right is the list pane, listing the JRE environment in the system, selecting your JRE, and then clicking "Edit ..." on the edge, a window will appear (edit JRE)
Select this entry for the Rt.jar file: "C:\Program Files\java\jre_1.5.0_06\lib\rt.jar" point to the left of the "+" sign to expand it
After you expand, you can see "source Attachment: (None)", click this item, point to the right of the button "Source Attachment ...", select the "src.zip" file under your JDK directory
Get!
Method Two:
Or when prompted to find the source code, add the source path:
How Eclipse views the JDK source code