Search

Categories

Links

Referers

The Compiler is Open Sourced

Nov 12 2006, 09:00:00 PM PST »Java»Compiler Comments [5]

Starting tomorrow, the Java™ compiler, javac, is available under the GPLv2 from openjdk.dev.java.net/compiler. :-D

I cannot help you interpret the license because I am not a lawyer. For the same reason, nothing on this blog is legal advice. Sun's lawyers cannot help you either because that could create a conflict of interest. Be sure to read the license carefully, the use of the Java trademark is restricted. Retain your own lawyer if you have any legal questions.

We continue to accept patches to the compiler. Before you submit a compiler patch, I recommend that you read my rules of thumb about maximizing your chances for getting a patch accepted.

All that being said, I am really excited about this and it has been real hard not to be able to talk about this. I hope to see a lot of projects prototyping new programming language constructs, and tighter integration with IDEs and other applications that use a compiler. We have already seen very cool things such as the Jackpot project and performance in GlassFish. Since both projects are open sourced, relying on closed source may have been a problem for some members of their respective communities. However, any such concerns should be history now.

Post a Comment:
Comments are closed for this entry.
Comments:

Does this mean I can ship Java6 compiler with my applications that run on JavaSE5?

Posted by Kohsuke Kawaguchi on November 13, 2006 at 08:52 AM PST #

This is a complicated question because of conformance rules and it depends on what you do and what you call it.

As I am not a lawyer, I cannot help you answer that question.

Posted by Peter von der Ahé on November 14, 2006 at 08:01 AM PST #

Are you aware that the released code of javac depends on several classes in sun.misc? Classpath hackers have been able to stub out these classes to the extent of making javac compile with ecj and (for simple cases) run against Classpath's libraries on open source VMs, but I'm sure they'd be grateful if javac were updated to lose these dependencies in the first place. Actually I'd guess there's a fair chance that within the next few weeks you'll be receiving patches to that effect, if you don't beat them to it ;)

Naughty developers, depending on sun.* packages ;)

(I'm not directly involved with the hackers doing this, I'm just cheerleading from the sidelines...)

Posted by Stuart Ballard on November 21, 2006 at 11:14 AM PST #

Stuart,
Yes it is true that we haven't open-sourced all of the JDK yet. We depend on sun.misc.Service and sun.misc.ServiceConfigurationError because we require that javac can run on JDK 5.0 (needed by IDEs such as NetBeans and Borland JBuilder, and JSP servers). Eventually, we can replace those by java.util.ServiceLoader.
The files from sun.reflect.annotation are more problematic and I'll look into open sourcing those.

Posted by Peter von der Ahé on November 21, 2006 at 02:08 PM PST #

Hi Peter, I know that during compilation a component tree is generated and same can be explored/traversed by Annotation Processor. I however don't know all steps involved in compilation process and other details. Can you pls point me to a link where i ca get sufficient info.

Posted by Gunjan on November 29, 2006 at 03:37 AM PST #

Java is a trademark of Sun Microsystems, Inc.
Copyright © 2006,2007 Peter von der Ahé