pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedpostgresql-9.2-1002.jdbc4.jar does not work with Java6
9+ messages / 5 participants
[nested] [flat]
* postgresql-9.2-1002.jdbc4.jar does not work with Java6
@ 2012-11-14 20:20 Thomas Kellerer <spam_eater@gmx.net>
0 siblings, 1 reply; 9+ messages in thread
From: Thomas Kellerer @ 2012-11-14 20:20 UTC (permalink / raw)
To: pgsql-jdbc
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
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6
@ 2012-11-14 20:31 Dave Cramer <pg@fastcrypt.com>
parent: Thomas Kellerer <spam_eater@gmx.net>
0 siblings, 1 reply; 9+ messages in thread
From: Dave Cramer @ 2012-11-14 20:31 UTC (permalink / raw)
To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc
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<http://www.postgresql.org/mailpref/pgsql-jdbc;
>
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6
@ 2012-11-14 20:49 Dave Cramer <pg@fastcrypt.com>
parent: Dave Cramer <pg@fastcrypt.com>
0 siblings, 3 replies; 9+ messages in thread
From: Dave Cramer @ 2012-11-14 20:49 UTC (permalink / raw)
To: Thomas Kellerer <spam_eater@gmx.net>; +Cc: pgsql-jdbc
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<http://www.postgresql.org/mailpref/pgsql-jdbc;
>>
>
>
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6
@ 2012-11-14 21:02 Thomas Kellerer <spam_eater@gmx.net>
parent: Dave Cramer <pg@fastcrypt.com>
2 siblings, 0 replies; 9+ messages in thread
From: Thomas Kellerer @ 2012-11-14 21:02 UTC (permalink / raw)
To: pgsql-jdbc
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.
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6
@ 2012-11-14 21:30 boscher.marc@gmail.com
parent: Dave Cramer <pg@fastcrypt.com>
2 siblings, 2 replies; 9+ messages in thread
From: boscher.marc@gmail.com @ 2012-11-14 21:30 UTC (permalink / raw)
To: pgsql-jdbc
>
> 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-jd...
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6
@ 2012-11-14 21:46 dmp <danap@ttc-cmc.net>
parent: Dave Cramer <pg@fastcrypt.com>
2 siblings, 0 replies; 9+ messages in thread
From: dmp @ 2012-11-14 21:46 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc
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;
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6
@ 2012-11-14 23:59 Dave Cramer <pg@fastcrypt.com>
parent: boscher.marc@gmail.com
1 sibling, 0 replies; 9+ messages in thread
From: Dave Cramer @ 2012-11-14 23:59 UTC (permalink / raw)
To: boscher.marc@gmail.com; +Cc: pgsql-jdbc
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-jd...
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6
@ 2012-11-15 09:44 Thomas Kellerer <spam_eater@gmx.net>
parent: boscher.marc@gmail.com
1 sibling, 1 reply; 9+ messages in thread
From: Thomas Kellerer @ 2012-11-15 09:44 UTC (permalink / raw)
To: pgsql-jdbc
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 compile but 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
^ permalink raw reply [nested|flat] 9+ messages in thread
* Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6
@ 2012-11-15 17:09 Adam Rauch <adam@labkey.com>
parent: Thomas Kellerer <spam_eater@gmx.net>
0 siblings, 0 replies; 9+ messages in thread
From: Adam Rauch @ 2012-11-15 17:09 UTC (permalink / raw)
To: 'Thomas Kellerer' <spam_eater@gmx.net>; pgsql-jdbc
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 compile against 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 compile but 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
^ permalink raw reply [nested|flat] 9+ messages in thread
end of thread, other threads:[~2012-11-15 17:09 UTC | newest]
Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-11-14 20:20 postgresql-9.2-1002.jdbc4.jar does not work with Java6 Thomas Kellerer <spam_eater@gmx.net>
2012-11-14 20:31 ` Dave Cramer <pg@fastcrypt.com>
2012-11-14 20:49 ` Dave Cramer <pg@fastcrypt.com>
2012-11-14 21:02 ` Thomas Kellerer <spam_eater@gmx.net>
2012-11-14 21:30 ` boscher.marc@gmail.com
2012-11-14 23:59 ` Dave Cramer <pg@fastcrypt.com>
2012-11-15 09:44 ` Thomas Kellerer <spam_eater@gmx.net>
2012-11-15 17:09 ` Adam Rauch <adam@labkey.com>
2012-11-14 21:46 ` dmp <danap@ttc-cmc.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox