How to attach JDK source code in Eclipse?

To attach JDK source code in Eclipse go to Windows=>Java=>Installed JREs, select your JRE and click on Edit button. In the JRE definition window select rt.jar and click on Source Attachment. Now you should see source attchment configuratin window. Select src.zip from JAVA_HOME.

Eclipse jdk source code attachment