Where is the source code for the java compiler? [closed]

牧云@^-^@ 提交于 2019-11-30 12:59:55

问题


I'm looking for the source code of Sun's standard java compiler, javac.

jdk1.6.0_07 has a few classes that are related, but they are interfaces (java.lang.Compiler and javax.tools.JavaCompiler). There's also some packages under com.sun.mirror.* and com.sun.source.*, which seem to be interfaces for representing the java abstract syntax tree.

But I can't find the compiler source - anyone know where it is?


回答1:


Check this site The Java programming-language compiler (javac) group. The sources are in the Mercurial repositories.

jdk7/tl/langtools (for JDK 1.7)

jdk6/jdk6/langtools (for JDK 1.6)

In the header of the two sites I linked to you find download links for the sources (in bz2, zip and gz format)

There you have the sources in src\share\classes\com\sun\tools\javac\




回答2:


It's here




回答3:


It is also here:

http://java.sun.com/javase/downloads/index.jsp

In the section:

Java SE 6 JDK Source Code



来源:https://stackoverflow.com/questions/1584544/where-is-the-source-code-for-the-java-compiler

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!