When importing the project into Eclipse we should align the project configuration so that Java 25 is used as the JRE but compatibility is set to Java 17 and the --release flag is used.
Initially this issue was raised against Spring Boot 4.1.x as projects that didn't have a system requirement of Java 25 would import with the default JRE (which could be different depending on the installation). The first attempt at fixing the issue caused build failures and was reverted. A second attempt will now be made targeting Spring Boot 4.0.x.