ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Ant 1.7 release
Date Fri, 02 Jun 2006 04:16:57 GMT
On Thu, 1 Jun 2006, Jan Materne <> wrote:
>>Not sure if we can build Ant 1.7 under JDK 1.5 also all in one 
>>go and still produce jars which can run under 1.2.
> Should be possible (but I would do a test after the build...)
> -target version Generate class files that will work on VMs with the
> specified version.

That's only one part of the problem.  The other one is that you might
be using methods introduced in later versions of the class library "by

Say there is a method 

     void doSomething(Object o);

in a class inside the Java class library of JDK 1.3 and a new overload

     void doSomething(String s);

was added in JDK 1.4.  Any call to doSomething("") compiled on JDK 1.4
and above will pick the String signature and fail with a
NoSuchMethodError (or IncompatibleClassChange, not sure) when run on
JDK 1.3.  There are several examples of changes like this in the JDK
so you can't be sure it works just bbbe setting the correct target.

Java 5 adds a completely new sort of problems with APIs retrofitted to
support generics.  Since Comparable is now Comparable<T> the
BigInteger class used to have a method

    int compareTo(Object)

and now has a 

    int compareTo(BigInteger)

and no Object signature alternative.  It is impossible to compile code
on JDK 1.5 that uses the method and still works on JDK 1.4 - but the
opposite is also true.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message