4

All, I just wondered how can I get the source of the rt.jar for JDK 1.7. I knew there is a source package name the src.zip under the JDK home path(supposed in the windows system). But it seems some classes of rt.jar is not included in it. Like sun.misc namespace. Did I miss something? Thanks.

Update

I just want to debug the source code of ConcurrentHashMap. I already compiled source from JDK src.zip and added into the endorsed folder. But found sun.misc.Unsafe still missing.

Joe.wang
  • 11,537
  • 25
  • 103
  • 180
  • Possible duplicate of [JDK/JRE source code with matching JSSE (SSL) source code and matching runnable JDK / JRE?](http://stackoverflow.com/questions/163552/jdk-jre-source-code-with-matching-jsse-ssl-source-code-and-matching-runnable-j) – ivan_pozdeev Mar 09 '16 at 05:58

2 Answers2

3

"But often you end up in Java class libraries, where there is debug information attached in the class files (at least those shipped with the JDK) but no source is present in src.zip. Official statement is that src.zip only contains publicly documented classes (i. e. the same ones that are covered by the official Javadoc)" I found this here. Seems like a possible explanation.

And I found the same discussion on stackoverflow and someone stated "sun.* sources are a part of JDK that is proprietary closed source Sun code (or Oracle since 2010).". And here the link again.

Community
  • 1
  • 1
Jernej K
  • 1,602
  • 2
  • 25
  • 38
0

You can get it via the Java Community Source Code Program.

user207421
  • 305,947
  • 44
  • 307
  • 483