Eclipse查看源码:Source not found

eclipse Ctrl +左键查看源代码Source not found

今天查看Object的源码出现Source not found
解决办法:
打开eclipse,依次点击Windows->Preferences->Java->Installed JREs
Eclipse查看源码:Source not found
点击Edit,然后找到以“rt.jar”结尾的文件双击打开
Eclipse查看源码:Source not found
点击Source Attachmment
在 “Source Attachment”对话框下,选择”External location“。路径为安装java JDK时的路径,命令行窗口使用java --verbose查看路径。
然后选择此路径下的src.zip

一切ok