Re: Can't build postgresql-jdbc-8.2-505 on Fedora 7

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-jdbc(at)postgreSQL(dot)org
Subject: Re: Can't build postgresql-jdbc-8.2-505 on Fedora 7
Date: 2007-04-23 23:57:25
Message-ID: 462D47E5.6000301@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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 line 17)
> [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 line 24)
> [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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2007-04-24 00:05:26 Re: JDBC feature request: auto savepoint per command
Previous Message Dave Cramer 2007-04-23 23:46:43 Re: Can't build postgresql-jdbc-8.2-505 on Fedora 7