Eclipse 查看源码出现 The jar file rt.jar has no source attachment 解决方法

Eclipse 查看源码出现 The jar file rt.jar has no source attachment 解决方法


因为 rt.jar 的 source 在 jdk 目录的 src.zip 文件里,将文件设置为 jdk 下的 src.zip 就行了。

具体如下 Window > Preferences > Java > InstalledJREs

选 jdk1.X,点 edit,jre systemlibraries 下面点 rt.jar 的那一栏,

然后选 source attachment . 在弹出的对话框里选入 src.zip 的路径 . 点击保存成功 !

下面图示 :


Eclipse 查看源码出现 The jar file rt.jar has no source attachment 解决方法


Eclipse 查看源码出现 The jar file rt.jar has no source attachment 解决方法


Eclipse 查看源码出现 The jar file rt.jar has no source attachment 解决方法


Eclipse 查看源码出现 The jar file rt.jar has no source attachment 解决方法