Eclipse/AS 如何查看jdk源码
2019-08-07 本文已影响0人
MonkeyLei
之前了一直是看api文档、doc比较多一些。现在正在看HashMap的一些深入点的知识,就想着需要跟下源码,同时学习下HashMap如何跟源码才能看得相对透彻。查了下相关看源码的工具,还是觉得Eclipse看Java源码比较不错。So...
1. Jdk安装以后呀,会有src.zip:

2. 然后安装Eclipse后随便新建一个工程

3. Ctril+点击跳转到源码的地方, 点击Attached source,添加选择外部的src.zip即可

4.之后我们就可以随意新建一个类啥的,然后直接跳转过去看源码....像int这些关键字不行哟...好了,我们继续学习。。。。
续集
AS也可以哒,废话不说了

<figcaption style="margin-top: 0.66667em; padding: 0px 1em; font-size: 0.9em; line-height: 1.5; text-align: center; color: rgb(153, 153, 153);">指定源码路径</figcaption>

<figcaption style="margin-top: 0.66667em; padding: 0px 1em; font-size: 0.9em; line-height: 1.5; text-align: center; color: rgb(153, 153, 153);">源码已出,谁与争锋</figcaption>