Getting langtools into Maven Central

Joe Darcy joe.darcy at oracle.com
Thu Dec 29 09:07:52 PST 2011


On 12/28/2011 2:44 PM, Jesse Glick wrote:
> On 12/28/2011 05:14 PM, Jonathan Gibbons wrote:
>> It may be appropriate to do this for OpenJDK 6 and 7
>
> I was thinking just do it for 7, and not bother with 6:
>
> 1. OpenJDK 6 does not seem to be perfectly synchronized with Oracle 
> JDK 6 in my experience (maybe this has changed recently), so its 
> versions of javac might be missing recent bug fixes.

Just speaking of langtools, for much of the last few years the javac in 
OpenJDK 6 has had a proper superset of the fixes in Oracle JDK 6 since 
OpenJDK 6 includes a large batch of fixes inherited from its JDK 7 
lineage. [1]

>
> 2. Even if you want to build for JDK 6, you can use javac from OpenJDK 
> 7 safely; just specify -source 6 -target 6 (which you should do anyway).

Don't forget to set the bootclasspath too! [2]

>> it is probably not appropriate for pre-release builds of 8.
>
> Agreed - these might implement APIs which are not yet standardized. I 
> was bringing up the suggestion of publishing langtools now because JDK 
> 7 is officially published, so there is no risk of advertising a 
> version of javac which implements an ultimately rejected aspect of 
> Project Coin or something like that.
>
> Anyway when JDK 8 is released, the components of langtools would be 
> available as modules (currently named jdk.compiler, jdk.javac, etc.) 
> and the manner of publishing would need to be revisited.
>
>> JSR 199 and JSR 269 are not available on JDK 5.
>
> Well, they are if you add the langtools JARs to your classpath, 
> assuming it continues to be compiled with -target 5 and avoid JDK 6+ 
> APIs.

The proper way to use JSRs 199 and 269 on JDK 5 would be to compile 
those APIs into a separate jar file.

-Joe

[1] "OpenJDK 6 Genealogy,"
http://blogs.oracle.com/darcy/entry/openjdk_6_genealogy

[2] "How to cross-compile for older platform versions,"
http://blogs.oracle.com/darcy/entry/how_to_cross_compile_for



More information about the compiler-dev mailing list