We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
对于 JDK6,您可以从 java.net 下载源代码。对于
java.lang
,故事从j2se/src/share/native/java/lang/
开始,然后搜索...JDK7稍微重新排列了目录结构。有些方法,例如
Object.hashCode
,可以通过热点来实现,而不是通过JNI/Java 实现,或者另外通过JNI/Java 来实现。JDK6 通过 Java 研究许可证 (JRL) 和 Java 内部使用许可证 (JIUL) 免费获得许可。 JDK7 和 OpenJDK6 在 GPL 2 下获得许可,但有 CLASSPATH 例外(粗略地说,您可以链接到它而不会感染 GNU 病毒)。我不是律师。
(
顺便说一句:真正的律师想指出,我仍然是 Sun Microsystems 的员工。Sun UK 已不复存在。现在是 Oracle。)更新(添加Thread.c 的位置:
http: //hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/src/share/native/java/lang/Thread.c
For JDK6 you can download the source from java.net. For
java.lang
the story begins atj2se/src/share/native/java/lang/
, and then search... JDK7 rearranges the directory structure a little.Some methods, such as
Object.hashCode
, may be implemented by hotspot instead or in addition to through JNI/Java.JDK6 is freely licensed through the Java Research License (JRL) and Java Internal Use License (JIUL). JDK7 and OpenJDK6 is licensed under GPL 2 with CLASSPATH exception (roughly speaking you can link to it without catching the GNU virus). I am not a lawyer.
(
BTW: The real lawyers would like to point out that I am still an employee of Sun Microsystems.Sun UK is no more. It is now Oracle.)Update (Adding location for Thread.c):
http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/src/share/native/java/lang/Thread.c
您可以查看 OpenJDK 的源代码(在 带有类路径异常的 GPLv2)。可能是研究 JDK 实现内部结构的最佳方法,除非您想受 Java 研究许可证,在这种情况下,您可以访问实际的 JDK 6 源。
You can look at the source code for OpenJDK (licensed under GPLv2 with Classpath Exception). Probably the best way to study the JDK implementation internals, unless you want to be bound by the Java Research Licence, in which case you can access the actual JDK 6 source.