Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi,

Context:
 Our Java7-support patch for hsqldb was a bit broken and enabled code
 that was supposed to be Java7-only also on Java 1.6. I fixed that in
 http://cgit.freedesktop.org/libreoffice/core/commit/?id=69273cdd675b205b6f47e9aab2872901c03be578

 This caused (among others) http://bugs.debian.org/675834, and my
 being unable to run embedded HSQL with gcj (when it was compiled with
 OpenJDK 1.6).


Point of this email:

While doing that, I noticed that our
 ./configure --with-java-target-version=XXX
was (at least partially) overridden internally by HSQL's own "detect
what Java version I'm being compiled by". So I prepared the attached
patch (which depends on my above commit).

But alas, it breaks "--with-java-target-version=1.5" when compiling
with OpenJDK 1.6:

    [javac] 
/home/master/src/libreoffice/core/hsqldb/unxlngx6/misc/build/hsqldb/src/org/hsqldb/jdbc/jdbcConnection.java:428:
 org.hsqldb.jdbc.jdbcConnection is not abstract and does not override abstract method 
createStruct(java.lang.String,java.lang.Object[]) in java.sql.Connection
    [javac] public class jdbcConnection implements Connection {
    [javac]        ^

That's because the method "createStruct" is in "#ifdef JAVA6".

OTOH, in the current situation, I predict that compiling with Java7 and
--with-java-target-version=1.5 will make .class files that CANNOT be
run under older Java, because that older Java will not have
SQLFeatureNotSupportedException (same problem as with GCJ).

So... We cannot hold the promise we give:

        [Generate class files that will work on JVMs with the
        specified version.
         For example, use --with-java-target-version=1.4 to make sure
         that the
         application will work with JVM 1.4 even when compiled with
         JDK 1.5.])

Or someone has a miracle solution?

-- 
Lionel
--- hsqldb/makefile.mk  2012-07-12 11:36:55.000000000 +0200
+++ hsqldb/makefile.mk.FAILED   2012-07-12 11:36:46.000000000 +0200
@@ -71,10 +71,20 @@
 .EXPORT : JAVA_HOME
 .ENDIF
 
+.IF   "$(JAVA_SOURCE_VER)"=="1.2" || "$(JAVA_SOURCE_VER)"=="1.3"
+ANT_ADD=-Dant.java.iscjava12=true -Dant.java.iscjavaset=true
+.ELIF "$(JAVA_SOURCE_VER)"=="1.4" || "$(JAVA_SOURCE_VER)"=="1.5"
+ANT_ADD=-Dant.java.iscjava14=true -Dant.java.iscjavaset=true
+.ELIF "$(JAVA_SOURCE_VER)"=="1.6"
+ANT_ADD=-Dant.java.iscjava16=true -Dant.java.iscjavaset=true
+.ELIF "$(JAVA_SOURCE_VER)"=="1.7"
+ANT_ADD=-Dant.java.iscjava17=true -Dant.java.iscjavaset=true
+.ENDIF
+
 .IF "$(JAVACISGCJ)"=="yes"
 BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) 
jar
 .ELSE
-BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" 
-Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f 
$(ANT_BUILDFILE) jar
+BUILD_ACTION=$(ANT) $(ANT_ADD) -Dbuild.label="build-$(RSCREVISION)" 
-Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f 
$(ANT_BUILDFILE) jar
 .ENDIF
 
 .IF "$(debug)"!=""

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.