--with-java-target-version does not work properly in hsqldb

Noel Grandin noel at peralex.com
Thu Jul 12 04:55:42 PDT 2012


Hi

Do this:

#ifdef JAVA6
     public void createStruct(java.lang.String,java.lang.Object[]) {
        ....real implementation....
     }
#else
    // only here for the odd situation that we are compiling 
--with-java-target-version=1.5 but the actual JDK we are using is > 1.5
     public void createStruct(java.lang.String,java.lang.Object[]) {
       throw new UnsupportedOperationException();
     }
#endif


Regards, Noel Grandin

On 2012-07-12 13:28, Lionel Elie Mamane wrote:
> 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?
>
>
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice



Disclaimer: http://www.peralex.com/disclaimer.html


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120712/537d8e96/attachment-0001.html>


More information about the LibreOffice mailing list