Update / clarification: I realized my original post listed the wrong versions.
I’m actually on Spring Boot 3.5.3 with Java 21.
For reference, here’s the relevant part of my build.gradle
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.3'
id 'io.spring.dependency-management' version '1.1.7'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
The rest of the question remains the same—just wanted to correct the environment details.