Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a21Nt-0005Ft-JW for pgsql-jdbc@arkaria.postgresql.org; Thu, 26 Nov 2015 18:35:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a21Nt-00062y-1l for pgsql-jdbc@arkaria.postgresql.org; Thu, 26 Nov 2015 18:35:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a21NO-0005T8-44 for pgsql-jdbc@postgresql.org; Thu, 26 Nov 2015 18:34:38 +0000 Received: from smtp.procolix.com ([95.215.185.30]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1a21NL-0003TD-7U for pgsql-jdbc@postgresql.org; Thu, 26 Nov 2015 18:34:37 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp.procolix.com (Postfix) with ESMTP id 58CB543E88 for ; Thu, 26 Nov 2015 19:34:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at smtp.procolix.com Received: from smtp.procolix.com ([127.0.0.1]) by localhost (host436.procolix.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VDYnk9HdRa0Q for ; Thu, 26 Nov 2015 19:34:31 +0100 (CET) Received: from [192.168.178.17] (53540792.cm-6-5a.dynamic.ziggo.nl [83.84.7.146]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mark@lawinegevaar.nl) by smtp.procolix.com (Postfix) with ESMTPSA id 370BF439D2 for ; Thu, 26 Nov 2015 19:34:31 +0100 (CET) Subject: Re: Migration to Maven To: List References: <2138484843.20942254.1448530099460.JavaMail.zimbra@redhat.com> <2113338928.20942725.1448530160996.JavaMail.zimbra@redhat.com> From: Mark Rotteveel Organization: Me, myself and I Message-ID: <565750BE.9090804@lawinegevaar.nl> Date: Thu, 26 Nov 2015 19:34:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On 26-11-2015 18:03, Adam Brightwell wrote: >> Our bigger problem is to figure out how to have JDK 1.6, 1.7, and 1.8 and >> ... all supported by one codebase > > Isn't that what the '-source' and '-target' flags for javac are meant > to help solve? That only helps if you are compiling the same software for different Java versions (and then it would suffice to just target Java 6, as Java 6 bytecode can also be run on newer Java versions). Also, if you use any new feature in the API, then compiling this way will lead to a false sense of security as a Java 7 compiler set to -source and -target 1.6 will **not** detect that you used new classes or methods (unless you explicitly specify a bootclasspath that points to the Java 6 runtime classes). The main problem however is that Java 6 is JDBC 4.0, Java 7 JDBC 4.1 and Java 8 JDBC 4.2. Each new version added new methods and requirements. If I recall correctly it should be possible to compile JDBC 4.1 compliant code with Java 6 (there might be some edge cases), however JDBC 4.2 added a number of new methods that take the SQLType interface, which was added in Java 8. On top of that, JDBC 4.2 compliance requires implementation of java.time support on get/setObject in PreparedStatement and ResultSet. Java.time was also introduced in Java 8. This makes it impossible to compile the same code for Java 6 and Java 8. You need to do some form of preprocessing, or selecting/combining version dependent sourcetrees. Mark -- Mark Rotteveel -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc