When we use Eclipse to develop Java projects, sometimes we need to look at the Java source code, but we need to first import the source code in eclipse before we can see
In the absence of import source code, we put the mouse in the need to view the Java source code, the use of shortcut keys (Ctrl + left), can not view the source code.
For example, when we want to see the source of the exist () method, the interface of Figure two appears.
(Figure I)
(Figure II)
Next is the process of importing the source code
1. Click on the Attach Source in Figure II and the interface below appears
2. Then add the path to the source code (Src.zip in the JDK's installation directory)
Click OK to complete
3. Once the add is complete, we can view the source code directly
For example: We try to open the file class source code, the mouse point to file, shortcut keys (Ctrl + left), the source code appears
Import source code in eclipse