[Pljava-dev] Compilation with both JDK 5 and JDK 6

From: books at ejurka(dot)com (Kris Jurka)
To:
Subject: [Pljava-dev] Compilation with both JDK 5 and JDK 6
Date: 2010-06-16 21:23:20
Message-ID: 4C1940C8.9020102@ejurka.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

On 6/16/2010 2:06 PM, Muhammad Mansoor wrote:
> On Wed, Jun 16, 2010 at 4:54 PM, Kris Jurka <books at ejurka.com
> <mailto:books at ejurka.com>> wrote:
>
> It does not appear to do this. A quick search through the patch
> doesn't reveal any matches for JDBC4 or USE_JDK6.
>
>
> These changes are there in the start of patch.

Sorry, I was looking at the wrong patch. I was looking at a version of
Petr's original patch. So my comments about whitespace changes are also
incorrect.

>
> + output := $(shell rm -rf
> "src/java/pljava/org/postgresql/pljava/jdbc")
> +
> + ifdef USE_JDK6
> + output := $(shell cp -rf
> "src/java/pljava/org/postgresql/pljava/jdbc4"
> "src/java/pljava/org/postgresql/pljava/jdbc")
> + else
> + output := $(shell cp -rf
> "src/java/pljava/org/postgresql/pljava/jdbc3"
> "src/java/pljava/org/postgresql/pljava/jdbc")
> + endif
> +
>
> I will make it more cleaner. Do you agree with the solution?
>

No, keeping two complete copies of slightly different code is not the
way to go. If you want to make pljava build against either JDK version
you need to provide JDBC4 classes extending JDBC3 classes like the
regular JDBC driver does so that only new JDBC4 code goes into the JDBC4
class, not a complete copy of the JDBC3 code. That's a significant
amount of work to do though and based on other comments on this list,
perhaps the best thing to do is to simply require JDK6 from here on out.

Kris Jurka

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message swaroop 2010-06-16 22:11:11 [Pljava-dev] please help - java.lang.ClassNotFoundException: org.postgresql.Driver
Previous Message Muhammad Mansoor 2010-06-16 21:06:23 [Pljava-dev] Compilation with both JDK 5 and JDK 6