eclipse查看源码:has no source attachment,you can attach the source by clicking Attach Source below:

如图所示:(提示基本上差不多)

eclipse查看源码:has no source attachment,you can attach the source by clicking Attach Source below:\

因为我们引用的都是jar,里面都是class编译文件,现在需要的是.java文件,所以需要下载

打开maven仓库----------------http://mvnrepository.com

eclipse查看源码:has no source attachment,you can attach the source by clicking Attach Source below:

如图所示:输入要找的名称:我的版本是log4j-1.2.8

eclipse查看源码:has no source attachment,you can attach the source by clicking Attach Source below:

eclipse查看源码:has no source attachment,you can attach the source by clicking Attach Source below:

eclipse查看源码:has no source attachment,you can attach the source by clicking Attach Source below:

找准source.jar即可!

eclipse查看源码:has no source attachment,you can attach the source by clicking Attach Source below:

然后把这个jar导入就可以看到源码了!