Eclipse界面如下:
Eclipse无法查看源代码,显示Source not found,The JAR file xxx has no source attachment
解决方法:

  1. Window---->Preferences
    Eclipse无法查看源代码,显示Source not found,The JAR file xxx has no source attachment
  2. 点击左侧 Java---->Installed JREs,点击右侧 Edit
    Eclipse无法查看源代码,显示Source not found,The JAR file xxx has no source attachment
  3. 点击 rt.jar(我这里是D:\Java\jre1.8.0_191\lib\rt.jar)---->点击下面的Source attachment(none) ---->点击右侧的Source attachment…
    Eclipse无法查看源代码,显示Source not found,The JAR file xxx has no source attachment
  4. 选择External location---->External File
    Eclipse无法查看源代码,显示Source not found,The JAR file xxx has no source attachment
  5. 选择你的JDK目录下的lib下的src.zip,然后一路确定
    Eclipse无法查看源代码,显示Source not found,The JAR file xxx has no source attachment
    最终结果:
    Eclipse无法查看源代码,显示Source not found,The JAR file xxx has no source attachment

相关文章: