java编译器的源代码在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1584544/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 16:29:19  来源:igfitidea点击:

Where is the source code for the java compiler?

javajavac

提问by 13ren

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

我正在寻找 Sun 的标准 java 编译器的源代码,javac.

jdk1.6.0_07 has a few classes that are related, but they are interfaces (java.lang.Compilerand 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.

jdk1.6.0_07 有一些相关的类,但它们是接口(java.lang.Compilerjavax.tools.JavaCompiler)。com.sun.mirror.*和下还有一些包com.sun.source.*,它们似乎是表示java抽象语法树的接口。

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

但是我找不到编译器源代码-有人知道它在哪里吗?

采纳答案by jitter

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

检查此站点Java 编程语言编译器 (javac) 组。源在 Mercurial 存储库中。

jdk7/tl/langtools(for JDK 1.7)

jdk7/tl/langtools(适用于 JDK 1.7)

jdk6/jdk6/langtools(for JDK 1.6)

jdk6/jdk6/langtools(适用于 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)

在我链接到的两个站点的标题中,可以找到源文件的下载链接(bz2、zip 和 gz 格式)

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

在那里你有src\share\classes\com\sun\tools\javac\ 中的源

回答by Foxfire

回答by OscarRyz

It is also here:

它也在这里:

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

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

In the section:

在该部分:

Java SE 6 JDK Source Code

Java SE 6 JDK 源代码