Where is the source code for the java compiler?

13ren picture 13ren · Oct 18, 2009 · Viewed 21.6k times · Source

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?

Answer

jitter picture jitter · Oct 18, 2009

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\