Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TZ2wj-0003mS-Cm for pgsql-jdbc@postgresql.org; Thu, 15 Nov 2012 17:09:45 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TZ2wg-0007Co-Ps for pgsql-jdbc@postgresql.org; Thu, 15 Nov 2012 17:09:44 +0000 Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id C8C50208EA; Thu, 15 Nov 2012 12:09:40 -0500 (EST) Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute2.internal (MEProxy); Thu, 15 Nov 2012 12:09:40 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:references:in-reply-to:subject :date:message-id:mime-version:content-type :content-transfer-encoding; s=smtpout; bh=8wMeIfLJDrP44D+G66ipSb mBuDs=; b=PTd5Ug5M7U1SqXWeivmZQhKWIG51FW56qYV/kpXGvVHXSYQvnNaMw5 bWL0hXdvwb8iVEAKgYvRDHvR08NONUEzZ2yrAGrYR1cbs3maoKbnEk8CZ/R9vQOQ lwy3UIYXDk1PQ/ptRL8T7zysX3VTMFGjo/JQF/gmIb0/F6OmFJRKQ= X-Sasl-enc: SYs6oCdqzIiSv6XykMzmIsb69E9+eDZ7o6WXGVwrq02A 1352999380 Received: from AdamE6420 (unknown [140.107.155.175]) by mail.messagingengine.com (Postfix) with ESMTPA id 535448E0525; Thu, 15 Nov 2012 12:09:40 -0500 (EST) From: "Adam Rauch" To: "'Thomas Kellerer'" , References: <0fa46b92-e6cd-446c-8101-2f995e621377@googlegroups.com> In-Reply-To: Subject: Re: postgresql-9.2-1002.jdbc4.jar does not work with Java6 Date: Thu, 15 Nov 2012 09:09:36 -0800 Message-ID: <06e001cdc353$fe219cd0$fa64d670$@labkey.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQFfcCxvWUfbMzheGnx9B8iJYRHkYQGP7gGMAaKcePMCnrteOAGybLxfmIuit0A= Content-Language: en-us X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201211/79 X-Sequence-Number: 23546 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=20 > javac =20 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