Обсуждение: postgresql-9.2-1002.jdbc4.jar does not work with Java6

Поиск
Список
Период
Сортировка

postgresql-9.2-1002.jdbc4.jar does not work with Java6

От
Thomas Kellerer
Дата:
Hi,

when trying to use postgresql-9.2-1002.jdbc4.jar with Java6 I get the following exception:

java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0

It works fine with Java7.

Is this intended? If yes, I think then description on the download page

    "If you are using the 1.6 or 1.7 JVM, then you should use the JDBC4 version."

should be updated.

Regards
Thomas

Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6

От
Dave Cramer
Дата:
No that is not intended. I actually think it should be JDBC4.1 ?


Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca



On Wed, Nov 14, 2012 at 3:20 PM, Thomas Kellerer <spam_eater@gmx.net> wrote:
Hi,

when trying to use postgresql-9.2-1002.jdbc4.jar with Java6 I get the following exception:

java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0

It works fine with Java7.

Is this intended? If yes, I think then description on the download page

   "If you are using the 1.6 or 1.7 JVM, then you should use the JDBC4 version."

should be updated.

Regards
Thomas



--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6

От
Dave Cramer
Дата:
Thomas,

I have rebuilt the jar with 1.6. I guess we can't use 1.7 to build jars, only to test if the build succeeds.

Dave

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca



On Wed, Nov 14, 2012 at 3:31 PM, Dave Cramer <pg@fastcrypt.com> wrote:
No that is not intended. I actually think it should be JDBC4.1 ?


Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca




On Wed, Nov 14, 2012 at 3:20 PM, Thomas Kellerer <spam_eater@gmx.net> wrote:
Hi,

when trying to use postgresql-9.2-1002.jdbc4.jar with Java6 I get the following exception:

java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0

It works fine with Java7.

Is this intended? If yes, I think then description on the download page

   "If you are using the 1.6 or 1.7 JVM, then you should use the JDBC4 version."

should be updated.

Regards
Thomas



--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc


Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6

От
Thomas Kellerer
Дата:
Dave Cramer wrote on 14.11.2012 21:49:
> Thomas,
>
> I have rebuilt the jar with 1.6. I guess we can't use 1.7 to build jars, only to test if the build succeeds.
>

That was quick!

Thank you very much.




Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6

От
dmp
Дата:
Dave,

If you have used the script to build the jars this would be a result of the
build for 1.7 over writing 1.6. The script was made to have JDBC4 for both
of these. As it cycles through the SDK 7 would be after 6 so the JDBC4 would
be replaced with last build. If you wish the to have the jar for these two SDK
different the script needs to change. The same will be true for JDBC2, & JDBC3.

JDBC4,   1.6?
JDBC4.1, 1.7?

danap.

Dave Cramer wrote:
> Thomas,
>
> I have rebuilt the jar with 1.6. I guess we can't use 1.7 to build jars,
> only to test if the build succeeds.
>
> Dave
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
>
>
> On Wed, Nov 14, 2012 at 3:31 PM, Dave Cramer <pg@fastcrypt.com
> <mailto:pg@fastcrypt.com>> wrote:
>
>     No that is not intended. I actually think it should be JDBC4.1 ?
>
>     Dave Cramer
>
>     dave.cramer(at)credativ(dot)ca
>     http://www.credativ.ca
>
>
>     On Wed, Nov 14, 2012 at 3:20 PM, Thomas Kellerer <spam_eater@gmx.net
>     <mailto:spam_eater@gmx.net>> wrote:
>
>         Hi,
>
>         when trying to use postgresql-9.2-1002.jdbc4.jar with Java6 I
>         get the following exception:
>
>         java.lang.__UnsupportedClassVersionError: org/postgresql/Driver
>         : Unsupported major.minor version 51.0
>
>         It works fine with Java7.
>
>         Is this intended? If yes, I think then description on the
>         download page
>
>         "If you are using the 1.6 or 1.7 JVM, then you should use the
>         JDBC4 version."
>
>         should be updated.
>
>         Regards
>         Thomas

    --
>         Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org
>         <mailto:pgsql-jdbc@postgresql.org>)
>         To make changes to your subscription:
>         http://www.postgresql.org/__mailpref/pgsql-jdbc
>         <http://www.postgresql.org/mailpref/pgsql-jdbc>



Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6

От
boscher.marc@gmail.com
Дата:
>
> I have rebuilt the jar with 1.6. I guess we can't use 1.7 to build jars, only to test if the build succeeds.
>

Isn't it just a question of specifying the target java version in javac
E.g. http://stackoverflow.com/questions/169044/how-to-compile-classes-to-jdk1-5-when-ant-is-running-in-jdk1-6


Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6

От
Dave Cramer
Дата:
That would be much easier.

Thanks,

Dave

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca



On Wed, Nov 14, 2012 at 4:30 PM, <boscher.marc@gmail.com> wrote:

>
> I have rebuilt the jar with 1.6. I guess we can't use 1.7 to build jars, only to test if the build succeeds.
>

Isn't it just a question of specifying the target java version in javac
E.g. http://stackoverflow.com/questions/169044/how-to-compile-classes-to-jdk1-5-when-ant-is-running-in-jdk1-6


--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

PgJDBC Build Script

От
dmp
Дата:
Dave,

I reviewed the building of the jars files for the various SDKs and the
original script I created did not properly build with the proper names.
I'm still not sure if this is correct, since the ant build.xml and web
page do not appear to correspond.

Corrected:

1.2 & 1.3, jdbc2
1.4 jdbc3
1.5 jdbc3g
1.6 jdbc4
1.7 & 1.8 jdbc41

The file is attached if you still wish to use it. I'm sorry for not
properly reviewing the requirements of the various required names
for the builds. I left the source creation the same for now.

Again if SDK 1.7 & 1.8 are both present then the result jdbc41 jar
will be the build from 1.8. Perhaps this should be checked and left
with the lower build jar file if present.

danap.


Вложения

Re: PgJDBC Build Script

От
Dave Cramer
Дата:
Dana,

Thanks for this! This is a work in progress, no apologies necessary.

Dave

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca



On Wed, Nov 14, 2012 at 8:26 PM, dmp <danap@ttc-cmc.net> wrote:
Dave,

I reviewed the building of the jars files for the various SDKs and the
original script I created did not properly build with the proper names.
I'm still not sure if this is correct, since the ant build.xml and web
page do not appear to correspond.

Corrected:

1.2 & 1.3, jdbc2
1.4 jdbc3
1.5 jdbc3g
1.6 jdbc4
1.7 & 1.8 jdbc41

The file is attached if you still wish to use it. I'm sorry for not
properly reviewing the requirements of the various required names
for the builds. I left the source creation the same for now.

Again if SDK 1.7 & 1.8 are both present then the result jdbc41 jar
will be the build from 1.8. Perhaps this should be checked and left
with the lower build jar file if present.

danap.


Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6

От
Thomas Kellerer
Дата:
boscher.marc@gmail.com, 14.11.2012 22:30:
>
> Isn't it just a question of specifying the target java version in javac

That is not completely reliable.

If you accidently include references to classes or methods in your code that are only available in Java7 it will still
compilebut fail to run with Java6. 

So if you want to be 100% it runs with Java6 you have to compile it with a Java6 JDK

Thomas




Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6

От
"Adam Rauch"
Дата:
You can avoid this problem by specifying a "bootclasspath," an alternate runtime library for javac to cross-compile
against. I always compile with JDK 7, for convenience and to take advantage of the latest fixes and compile-time
optimizations,but when targeting 1.5, I specify a Java 5 copy of rt.jar on the bootclasspath and when targeting 1.6, I
compileagainst the Java 6 rt.jar.  This eliminates the possibility of errant references. 

javac switch  is -bootclasspath (http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html)
javac ant task parameter is bootclasspathsrc (http://svn.apache.org/repos/asf/ant/core/trunk/manual/Tasks/javac.html)

Adam

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Thomas Kellerer
Sent: Thursday, November 15, 2012 1:45 AM
To: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] postgresql-9.2-1002.jdbc4.jar does not work with Java6

boscher.marc@gmail.com, 14.11.2012 22:30:
>
> Isn't it just a question of specifying the target java version in
> javac

That is not completely reliable.

If you accidently include references to classes or methods in your code that are only available in Java7 it will still
compilebut fail to run with Java6. 

So if you want to be 100% it runs with Java6 you have to compile it with a Java6 JDK

Thomas






--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc