如何引用外部jar包和查看源码的相关操作
本次案例使用的jar包是apache下一个操作日记的开源项目:log4j
相关的jar包和源码可以自行百度
下面着重介绍引入和查阅源码的步骤:
1. 项目右键,属性,按照图下选择
2. 选中引用的jar包
3. 导入jar包后,选中jar包,选中source attachment进行编辑,链接到源码的jar包
4.如下图
有时候我们想要查看源码,但是有没有src,这时候可以利用eclipse开发工具的反编译插件来实现,具体步骤如下:
1-安装插件
help-Eclipse MarketPalce-Decompiler安装
2-设置
Window-preference-General-Editors-File Associations-.class-Class File Viewer-Default
-.class without source - Class Decompiler Viewer- default