The jar file rt.jar has no source attachment appears in eclipse

Original text: http://blog.csdn.net/u011514810/article/details/53196371

————————————————————————————————-

As a rookie, it is very important to check the Java source code. It’s very convenient to view the source code of a class in eclipse. Directly press and hold the CTRL + mouse click class or method, then the source code of this class or method will appear. However, before that, you need to import the source code src.zip into eclipse. This source code src.zip does not need to be downloaded. As long as you install JDK, there will be src.zip in the directory where JDK is installed. There is no need to unzip it. Let’s see how to import the source code into eclipse

1. In the eclipse interface, click window — preferences — Java — installed jres

2. Select d: Java. Lib. RT. Jar, and then select source attachment

3. Select external location, click external file, browse the directory where JDK is installed, find src.zip, click OK and finish

Similar Posts: