Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.)

like image 537
Hosam Aly Avatar asked Jan 04 '09 09:01

Hosam Aly


People also ask

Is OpenJDK open-source?

The Red Hat® build of OpenJDK is a free and open source implementation of the Java Platform, Standard Edition (Java SE). It is an alternative that will allow your organization to stabilize and standardize your Java environments for years to come with little to no transition effort.

Where can I find Java source code?

Install the Java SE Development Kit from http://java.sun.com/javase/downloads/index.jsp. Once installed, you should find an archive called src. zip in the top of the JDK installation directory. The Java source code is in there.

Is OpenJDK free for commercial use?

Public updates for Oracle Java SE 8 released after January 2019 won't be available for business, commercial, or production use without a commercial license, as Oracle announced. However, OpenJDK is completely open source and can be used freely.

Who is maintaining OpenJDK?

Red Hat is now taking over the responsibility of maintaining OpenJDK for Java versions 8 and 11. Java 8 will be supported till June 2023 while Java 11 will receive updates till October 2024. Red Hat has previously maintained OpenJDK 7, it will continue to support it till June 2020.


2 Answers

OpenJDK is now on GitHub: https://github.com/openjdk/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

like image 114
Rasmus Faber Avatar answered Sep 29 '22 15:09

Rasmus Faber


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/

like image 20
Abdull Avatar answered Sep 29 '22 15:09

Abdull