Tom Lane wrote:
> So I tried to import 8.2-505 into Red Hat's development tip, and it blew
> up on me with errors that look like Java version incompatibilities,
> for instance
>
> [javac] 53. ERROR in /builddir/build/BUILD/postgresql-jdbc-8.2.505/org/postgresql/jdbc3g/Jdbc3gArray.java (at
line17)
> [javac] public class Jdbc3gArray extends org.postgresql.jdbc2.AbstractJdbc2Array implements java.sql.Array
> [javac] ^^^^^^^^^^^
> [javac] The type Jdbc3gArray must implement the inherited abstract method Array.getArray(long, int, Map)
> [javac] ----------
>
> [javac] 57. ERROR in /builddir/build/BUILD/postgresql-jdbc-8.2.505/org/postgresql/jdbc3g/Jdbc3gArray.java (at
line24)
> [javac] public Object getArray(Map < String, Class < ? >> map) throws SQLException
> [javac] ^^^^^^^^^^^^^
> [javac] Syntax error, parameterized types are only available if source level is 5.0
> [javac] ----------
>
> The identical SRPM builds fine on my Fedora Core 6 workstation, although
> I notice it says
>
> [echo] Configured build for the JDBC3 edition driver with SSL
>
> where the failed build has
>
> [echo] Configured build for the JDBC3g edition driver with SSL
>
> FC6 has java-1.4.2 where 7 has java-1.5.0.
It looks like ant's java.specification.version is reporting 1.5 (hence
configuring the build for "jdbc3g" -- JDBC3 + generics), but the default
ant <javac> task (with no source=... parameter) is invoking a compiler
that is expecting 1.4 source. I'm guessing that's because gcj is
implementing 1.5 but defaulting to 1.4 source (which is different to the
Sun JVM)
You could try adding 'source="1.5"' as an attribute of the <javac> task.
Or if you're running Ant 1.7 you can pass -Dant.build.javac.source=1.5
on the ant command line. (both untested)
-O