像GrepCode一样在Eclipse中浏览JDK源代码 [英] Browse JDK Source Code in Eclipse Like GrepCode
问题描述
I like the way you can browse the source code of a library in GrepCode. Is there any way I can do the same in Eclipse?
我知道我可以打开一个类的声明并仔细查看它,但是似乎无法在声明窗口中搜索某些内容(例如,一种方法).
I know that I can open the declaration of a class and look through it, but there seems to be no way I can search for something (a method, for example) in the Declaration window.
我真正想要的是一种浏览标准库的源代码的方法,就像浏览正在编写的类的源代码一样.它不一定是我的JDK附带的源.我也很高兴看到其他版本.
What I am really looking for is a way to browse the source code of the standard library just like I browse the source code of a class I am writing. It doesn't necessarily have to be the source that ships along with my JDK; I am happy to look at some other version as well.
实现此目标的最佳方法是什么?我是否需要下载OpenJDK并将其添加为Eclipse中的项目?
What would be the best way to achieve this? Will I have to download OpenJDK and add it as a project in Eclipse?
推荐答案
实际上,我只是使用Eclipse中的搜索"功能.由于我想查看JRE库中类的源代码,因此我只需进行搜索-> Java 并选择适当的选项(请参阅随附的屏幕截图).
Actually I just went with the Search feature in Eclipse. Since I wanted to look at the source code for classes in the JRE libraries, I just do Search --> Java and select the appropriate options (see the attached screenshot).
我认为该搜索功能也可以用于在您的构建路径中包含的库中进行搜索.
I would think that this Search feature could also be used to search in the libraries included in your build path too.
这篇关于像GrepCode一样在Eclipse中浏览JDK源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!