当前位置: 代码迷 >> 综合 >> Eclipse无法查看源代码,显示Source not found,The JAR file xxx has no source attachment
  详细解决方案

Eclipse无法查看源代码,显示Source not found,The JAR file xxx has no source attachment

热度:73   发布时间:2024-01-27 02:32:09.0

Eclipse界面如下:
在这里插入图片描述
解决方法:

  1. Window---->Preferences
    在这里插入图片描述
  2. 点击左侧 Java---->Installed JREs,点击右侧 Edit
    在这里插入图片描述
  3. 点击 rt.jar(我这里是D:\Java\jre1.8.0_191\lib\rt.jar)---->点击下面的Source attachment(none) ---->点击右侧的Source attachment…
    在这里插入图片描述
  4. 选择External location---->External File
    在这里插入图片描述
  5. 选择你的JDK目录下的lib下的src.zip,然后一路确定
    在这里插入图片描述
    最终结果:
    在这里插入图片描述
  相关解决方案