Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I want to have a look at how Java implements LinkedList. Where should I go to look at the source code?

like image 803
ashokgelal Avatar asked Nov 04 '08 05:11

ashokgelal


People also ask

Where is JDK source code?

The JDK source code is inside the src. zip , this article shows you how to get it on Windows, Ubuntu (Linux) and Mac OSX.

Can you view Java source code?

The IDE's built-in Source Editor enables you to view, create, and edit your Java source code. Open the Source Editor window by double-clicking a node in the Projects window, Files window, or Navigator window. Alternatively, you can open the Source Editor by choosing File > New to create a new file.

How can I see the JDK code in Eclipse?

Go to Windows->Preferences->Java->Installed JREs. Select Browse and navigate to the C:\Program Files\Java\jdk1. 6.0_21 directory. Eclipse will automatically find the source and associate it with the JDK classes.


1 Answers

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.

like image 197
Bill Karwin Avatar answered Oct 25 '22 05:10

Bill Karwin