1

For example, I would like to see the code of the class Line2D in the package java.awt.geom. How can I find it?

1

3 Answers 3

4

Go to jdk home folder. There will be a folder named src. In that you will get source code of all the inbuilt java classes.

C:\Program Files\Java\jdk<version>\src\java\awt\geom\Line2D.java

Probably you might be having src.zip folder. You can unzip it.

Sign up to request clarification or add additional context in comments.

5 Comments

The JRE does not contain src. Also the file extension on that seems suspicious.
@RohitJain. You are right, I am a noob and I was wrong. :) I'll edit the title.
@RohitJain. You anticipated me. :) However, I have to wait for a few minutes before accepting the answer.
@RohitJain. No, it is the website which does not allow me to accept the answer immediately.
@RohitJain. Done. Thanks again for the quick help!
0

You have one implementation at OpenJDK http://download.java.net/openjdk/jdk6/

Comments

0

If you have JDK, it's a file named src.zip inside JDK root folder.

Common 32bits location:

C:\Program Files (x86)\Java\jdk<version>\src.zip

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.