The procedure is as follows:
1. Click "window"-> "Preferences"-> "Java"-> "installed jres"
2. in this case, the right side of "installed jres" is the List Pane, listing the system's JRE environment. Select Your JRE and click "Edit... ", a window appears (edit JRE)
3. Select the Rt. jar file: "C: \ Program Files \ Java \ jre_1.5.0_06 \ Lib \ RT. Jar"
Click "+" on the left to expand it,
4. after expansion, You can see "Source attachment :( none)", click this item, and click "Source attachment... ", select the" cmdsrc.zip "file under your JDK directory (this file is in the root directory of the JDK installation directory)
5. Click "OK" all the way. The setting is complete.
After setting, press Ctrl and then click a JDK method name or class name.Source code. In addition, you can also press F3.
PS:Rt. jar contains the JDK base class library, that is, all the class's classfile that you see in Java Doc contains the source file corresponding to the basic class (that is *. java files). Similarly, we can download the source of each Java open-source framework from the Internet.CodePackage, such as spring-src.zip, and then follow the settings above to view the corresponding Java framework source code.