Project

Profile

Help

Building on system with JDK 11 and JDK 17

Added by E L over 1 year ago

When building on a Linux system with JDK 17 installed as well as JDK 11, the build fails, using Gradle, showing the following console output:

> Task :buildSrc:compileGroovy FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildSrc:compileGroovy'.
> BUG! exception in phase 'semantic analysis' in source unit '<basedir>/saxonmirrorhe.he/buildSrc/src/main/groovy/JarSignPlugin.groovy' Unsupported class file major version 61

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

The build properties appear to set the compile targets for a desired byte code revision, but the Java runtime used for processing the build may be newer than the one supported.

Are any settings available for utilizing the JDK of version 11, without interference by the one of version 17 installed on the same system?


Replies (6)

Please register to reply

Building on system with JDK 11 and JDK 17 - Added by Norm Tovey-Walsh over 1 year ago

When building on a Linux system with JDK 17 installed as well as JDK
11, the build fails, using Gradle, showing the following console
output:

That’s interesting. My first guess is that you attempted to build with
JDK 17 at one point, which caused the buildSrc libraries to be built
with JDK 17. When you switched to JDK 11, they didn’t get recompiled.
Or something.

If you delete the build and buildSr/build directories and try again,
does it work?

Be seeing you,
norm

--
Norm Tovey-Walsh
Saxonica

RE: Building on system with JDK 11 and JDK 17 - Added by E L over 1 year ago

Norm Tovey-Walsh wrote in Building on system with JDK 11 and JDK 17:

That’s interesting. My first guess is that you attempted to build with
JDK 17 at one point, which caused the buildSrc libraries to be built
with JDK 17. When you switched to JDK 11, they didn’t get recompiled.
Or something.

If you delete the build and buildSr/build directories and try again,
does it work?

The problem persists even after invoking git clean -fdx.

RE: Building on system with JDK 11 and JDK 17 - Added by Norm Tovey-Walsh over 1 year ago

The problem persists even after invoking git clean -fdx.

Interesting. I’ll see what I can figure out.

Be seeing you,
norm

--
Norm Tovey-Walsh
Saxonica

RE: Building on system with JDK 11 and JDK 17 - Added by E L over 1 year ago

For reference I am operating on a system running Linux Mint, with JDK supplied by packages openjdk-17-jdk (and openjdk-11-jdk).

RE: Building on system with JDK 11 and JDK 17 - Added by Norm Tovey-Walsh over 1 year ago

Saxonica Developer Community writes:

Norm Tovey-Walsh wrote in Building on system with JDK 11 and JDK 17:
If you delete the build and buildSr/build directories and try again,
does it work?

The problem persists even after invoking git clean -fdx.

I wasn’t able to reproduce this. I created a new Linux VM and installed
both JDK 11 and JDK 17. I made JDK 11 the default. I checked out the HE
mirror repository and ran the build.

It fails (see previous message), but I don’t get any errors about the
version of the class files in buildSrc. I’m not sure what could be wrong.

Be seeing you,
norm

--
Norm Tovey-Walsh
Saxonica

RE: Building on system with JDK 11 and JDK 17 - Added by E L over 1 year ago

Norm Tovey-Walsh wrote in RE: Building on system with JDK 11 and JDK 17:

I wasn’t able to reproduce this. I created a new Linux VM and installed
both JDK 11 and JDK 17. I made JDK 11 the default. I checked out the HE
mirror repository and ran the build.

What do you mean by you "made JDK 11 the default"? What were your actual steps? I am not aware that I represented the test conditions as taking any such steps.

    (1-6/6)

    Please register to reply