bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
532 stars 305 forks source link

Building not possible with Java 21 #6298

Closed kwin closed 2 months ago

kwin commented 2 months ago

Despite https://github.com/bndtools/bnd/blob/master/README.md#building stating

We require at least Java 17.

building with JDK21 failed with

./gradlew :build
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'bnd'.
> Could not open proj generic class cache for build file '.../build.gradle' (<userhome>/gradle/caches/8.1.1/scripts/8hgbzs53rwizrb7z9g3ua5ev4).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65

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

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

BUILD FAILED in 41s

It worked fine with JDK17. So it seems that newer JDKs don't work yet.

kwin commented 2 months ago

According to https://docs.gradle.org/8.8-rc-1/userguide/compatibility.html you need Gradle 8.4 at least for supporting JDK21.

chrisrueger commented 2 months ago

I updated gradle wrapper in https://github.com/bndtools/bnd/pull/6280

Do you have the latest code?

kwin commented 2 months ago

Indeed I was some commits behind. With latest master it works with JDK21.