After upgrading to JDK 21, I have the following compilation error in my Spring Boot project:
Fatal error compiling: java.lang.NoSuchFieldError:
Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid'
The culprit is Lombok. The minimal Lombok version compatible with JDK 21 is 1.18.30
.
This implies that the minimal Spring Boot version is 3.1.4
, unless you want to meddle with the Spring Boot dependency management and set the Lombok version in your project differently from the Spring Boot BOM defined in spring-boot-dependencies
.