Where can I see the source code of the Sun JDK? Where can I see the source code of the Sun JDK? java java

Where can I see the source code of the Sun JDK?


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.

The file is java/util/LinkedList.java.

update: You may also like to visit the online OpenJDK Source repository. See this answer below.


The sources are hosted at hg.openjdk.java.net. You can find the library sources for a specific JDK version under src/share/classes. For example, the JDK 8 source for java.util.LinkedList is located at:

hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/tip/src/share/classes/java/util/LinkedList.java

You can follow the instructions here to explore the source.