Ship jdk7 ct.sym with jdk8?
Joe Darcy
joe.darcy at oracle.com
Wed Mar 13 09:04:18 PDT 2013
On 3/11/2013 4:35 PM, Jonathan Gibbons wrote:
> On 03/11/2013 04:29 PM, Martin Buchholz wrote:
>> If you want to build some java software that targets jdk6, the
>> natural way to do it is via -target 6. But then javac will complain
>> it also wants -source 6 (that's easy to fix) but also a bootclasspath
>> for jdk6, which is harder for the user to provide.
>>
>> One obvious way to make the user's life easier is to ship a ct6.sym,
>> ct7.sym, ct8.sym,
>> where each .sym contains the deltas relative to the previous version.
>> Then we could have -target 6 default to compiling against ct6.sym,
>> while -target 8 will default to ct8.sym:ct7.sym:ct6.sym
>>
>> Perhaps you are already doing this kind of thing to support profiles
>> in jdk8?
>
> It would be logistically hard to include binary products from earlier
> builds in the current build.
>
> A better solution would be to verify that the @since tags are up to
> date (I know you did this for JDK 5) and then feed the @since info
> into ct.sym, so that the current ct.sym knows about when API was first
> available. That way, the user could specify -target 6, and javac
> could use the appropriate subset of ct.sym.
>
The @since information could be used to represent most, but not all, of
the cross-compile to an older platform information. It does not capture
cases like "In JDK 7, a class from JDK 6 is retrofitting to implement an
interface from JDK 5." We've had that kind of situation occur in JDK 7
when Closeable from added to some classes. Also, generification of
classes, including changing a normal override to a covariant override
would not be captured in @since.
-Joe
More information about the compiler-dev
mailing list