Kotlin and java20/21 fail

root@uefi-arm64:/usr/src/kotlin# ./gradlew build --info
Initialized native services in: /root/.gradle/native
Initialized jansi services in: /root/.gradle/native
Received JVM installation metadata from ‘/usr/lib/jvm/java-21-openjdk-arm64’: {JAVA_HOME=/usr/lib/jvm/java-21-openjdk-arm64, JAVA_VERSION=21-ea, JAVA_VENDOR=Debian, RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=21-ea+29-Debian-1, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=21-ea+29-Debian-1, VM_VENDOR=Debian, OS_ARCH=aarch64}
The client will now receive all logging from the daemon (pid: 5290). The daemon log file: /root/.gradle/daemon/8.1.1/daemon-5290.out.log
Starting 3rd build in daemon [uptime: 5 mins 23.748 secs, performance: 97%, GC rate: 0.00/s, heap usage: 1% of 1.4 GiB]
Using 4 worker leases.
Now considering [/usr/src/kotlin] as hierarchies to watch
Now considering [/usr/src/kotlin/buildSrc, /usr/src/kotlin] as hierarchies to watch
Watching the file system is configured to be enabled
File system watching is active
Starting Build
Compiling settings file ‘/usr/src/kotlin/settings.gradle’ using SubsetScriptTransformer.

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not open cp_settings generic class cache for settings file ‘/usr/src/kotlin/settings.gradle’ (/root/.gradle/caches/8.1.1/scripts/epgilimmen0r5igry0xl8wkq1).

BUG! exception in phase ‘semantic analysis’ in source unit ‘BuildScript’ Unsupported class file major version 65

debian-bookworm openjdk-17