spring-projects / spring-authorization-server

Spring Authorization Server
https://spring.io/projects/spring-authorization-server
Apache License 2.0
4.78k stars 1.25k forks source link

Build failed for samples #1614

Closed konstantinj closed 1 month ago

konstantinj commented 1 month ago

Describe the bug

Build error for samples (ttps://github.com/spring-projects/spring-authorization-server/tree/main/samples)

./gradlew -b samples/demo-authorizationserver/samples-demo-authorizationserver.gradle bootRun
Downloading https://services.gradle.org/distributions/gradle-8.6-bin.zip
............10%.............20%............30%.............40%.............50%............60%.............70%.............80%............90%.............100%

Welcome to Gradle 8.6!

Here are the highlights of this release:
 - Configurable encryption key for configuration cache
 - Build init improvements
 - Build authoring improvements

For more details see https://docs.gradle.org/8.6/release-notes.html

Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
Could not open cp_settings generic class cache for settings file '/github/spring-authorization-server/settings.gradle' (/Users/xxxxxx/.gradle/caches/8.6/scripts/8p1dsh50yfy2z8nn9b37nu6aq).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 66

To Reproduce Got a fresh clone of the repo and ran: ./gradlew -b samples/demo-authorizationserver/samples-demo-authorizationserver.gradle bootRun

Expected behavior Working samples

If that matters: The samples worked for me some month ago. I've switched to a Macbook M3 and now have java 22 running.

SanthoshKani commented 1 month ago

@konstantinj Maybe this helps https://docs.gradle.org/8.6/userguide/compatibility.html#java

A Java version between 8 and 21 is required to execute Gradle. Java 22 and later versions are not yet supported.

jgrandja commented 1 month ago

Thanks for your response @SanthoshKani !

@konstantinj As noted

Java 22 and later versions are not yet supported.