Is it possible to browse the source of OpenJDK online?

后端 未结 8 1912
借酒劲吻你
借酒劲吻你 2020-12-04 07:50

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:

相关标签:
8条回答
  • 2020-12-04 08:00

    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

    0 讨论(0)
  • 2020-12-04 08:06

    Surely http://hg.openjdk.java.net is one good option. The other equally good source is zGrepCode https://zgrepcode.com/java/openjdk/ . It has both Open JDK and Oracle java versions.

    0 讨论(0)
  • 2020-12-04 08:08

    Grepcode.com is great for similar things - not only OpenJDK sources, with searching in classes/methods and links between classes directly in highlighted code:

    http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/java/net/Socket.java

    0 讨论(0)
  • 2020-12-04 08:11

    As mentioned in the other answers, the source code repository is at https://hg.openjdk.java.net

    However, the OpenJDK team mirrors some of the projects on GitHub: https://github.com/openjdk

    Including the latest Java version project (https://hg.openjdk.java.net/jdk/jdk): https://github.com/openjdk/jdk

    0 讨论(0)
  • 2020-12-04 08:12

    Here's a way to browse the repositories and look at just the bits you want. http://hg.openjdk.java.net/ Is that what you are asking?

    0 讨论(0)
  • 2020-12-04 08:14

    The latest JDK 8 OpenJDK Java Class Library source code can be found here: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/tip/src/share/classes/

    0 讨论(0)
提交回复
热议问题