Running Saxon 12 with Java 8?

Added by Martin Honnen over 1 year ago

Congrats on the release of Saxon 12.

I have a question on the use of Saxon 12 Java with Java 8: the documentation!about/installationjava/prerequisites says

To run SaxonJ you need at least a Java VM, and preferably a Java development environment. SaxonJ 12 requires at least Java SE 8 (also known as JDK 1.8). SaxonJ 12 is built and tested using Java SE 11, but should also still be usable with Java 8 or later

However, when I try to run the Saxon HE 12.0 with java 8, it tells me

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/sf/saxon/Transform has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at sun.launcher.LauncherHelper.checkAndLoadMain(

That probably just means that JDK 11 compiled Java code can't be executed with Java 8.

Or can you compile with Java 11 but ensure that the class file version is compatible with Java 8?

Replies (2)

RE: Running Saxon 12 with Java 8? - Added by Michael Kay over 1 year ago

Thanks. Our intent was to move to Java 11 as the baseline, though I was under the impression we were generating code that would run under 8 if required. We'll look into it, but we're prepared to drop support for anything earlier than Java 11 if necessary.

RE: Running Saxon 12 with Java 8? - Added by Martin Honnen over 1 year ago

import java.lang.ref.Cleaner used in and (at least) doesn't seem to compile with JDK 8, at least not the OpenJDK.

But I guess it is time to move to a newer Java version (if only that were as easy for IKVM as it is on a normal PC system)


    Please register to reply