Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
328 views
in Technique[技术] by (71.8m points)

mercurial - Is it possible to browse the source of OpenJDK online?

Is it possible to browse the source code of OpenJDK online, just like I can do with SourceForge's projects? I never used Mercury before, so I felt confused.

(Note: I don't want to download the source. I just want to browse it online, to see how some methods are implemented.)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

OpenJDK is now on GitHub: https://git.openjdk.java.net/jdk

It is a large project, but you will find the implementations of the core classes under jdk/src/java.base/share/classes.

For instance you can find the implementation of java.util.List here.


If you need to browse older versions, you still need to use the old Mercurial interface.

The Mercurial interface there is quite confusing if you are not used to it, and since this is a large project, it can be hard to find what you are looking for.

Here is an example:

To find the JDK6 implementation java.util.List, select "jdk6", "jdk", select browse. Then browse to src/share/classes/java/util/List.java.

You should end up at http://hg.openjdk.java.net/jdk6/jdk6/jdk/file/tip/src/share/classes/java/util/List.java


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...