-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] lombok 1.8.26 incompatible with JDK21 #3393
Comments
I probably should have opened this as a "Feature Request"? |
Whether you consider this a bug or a feature is debatable. In any case, thanks for creating it. |
@Rawi01 is lombok compatible with Java 20? Last changelog only mentions JDK 19 |
My apologies, I have missed that! |
Very slow release cycle for 20 and 19 Java versions. I understand that odd versions are interpreted as cutting edge and even as stable, but maybe we need to split releases which adds only support for new Java releases and feature-rich releases? |
When can we expect the fix to be integrated? I just tested with the latest build (21.ea.26-open) and it fails with the same stacktrace. That build is now feature complete, so there should not be any big changes before the GA release in September. |
There are some more failing tests using the latest ea build. I will try to fix that this week, |
Any workarounds? |
Just wondering if there is any news on this or any workarounds? |
This is also a problem for NetBeans, which builds on top of javac and no renders all lombok using classes as broken. |
You can use my jdk21 branch or download the ci build artifact if you really need to use JDK21 now. |
@Rawi01 please release a central version with these changes. I tried edge snapshot from https://projectlombok.org/download-edge locally with JDK 21 ea b34, and my code base builds and passes tests - thanks a lot for the fix! I would like to use it in CI builds that run against Java 21 EA, but i can't due to constraints on which repositories i can use there. |
I am finding even with the edge version I am still getting the same result, java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' openjdk version "21" 2023-09-19 |
I just wanted to throw in with this. Java 21 and eventually 22 will be VERY important to me and my team as we are starting to use Panama for our projects, which will be out of pre-release starting in Java 22 (March 2024). I was able to get past the error above, once I included the repository and changed to the edge release, but this came up.
Here are the changes I made to my pom.xml to get it to compile again. For some reason I had to specifically add the org.slf4j dependency as well to get things to work. <project ...>
...
<repositories>
<repository>
<id>projectlombok.org</id>
<url>https://projectlombok.org/edge-releases</url>
</repository>
</repositories>
...
<dependencies>
...
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>edge-SNAPSHOT</version>
</dependency>
</dependencies>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compilerplugin.version}</version>
<configuration>
<source>21</source>
<target>21</target>
<enablePreview>true</enablePreview>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>edge-SNAPSHOT</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
...
</plugins>
</build>
...
</project> |
The message about annotation processing was backported to 21 but should not break the compilation, it is only a warning and it disappears if you add lombok as explicit annotation processor (as you did). Slf4j is not required for lombok and it should not change anything expect you You should also add |
This is resolved using edge-SNAPSHOT, I had missed the annotation processor |
Major features can be found here: https://advancedweb.hu/a-categorized-list-of-all-java-and-jvm-features-since-jdk-8-to-21/ Required companion upgrades: - Gradle 8.0.2 -> 8.4, see https://docs.gradle.org/8.4/userguide/upgrading_version_8.html for changes - Lombok 1.18.24 -> 1.18.30, see projectlombok/lombok#3393 - Spring Boot 3.0.1 -> 3.1.4 to support new version of Lombok, see https://stackoverflow.com/a/77171271
Major features can be found here: https://advancedweb.hu/a-categorized-list-of-all-java-and-jvm-features-since-jdk-8-to-21/ Required companion upgrades: - Gradle 8.0.2 -> 8.4, see https://docs.gradle.org/8.4/userguide/upgrading_version_8.html for changes - Lombok 1.18.24 -> 1.18.30, see projectlombok/lombok#3393 - Spring Boot 3.0.1 -> 3.1.4 to support new version of Lombok, see https://stackoverflow.com/a/77171271
Adding it solved the problem. |
to solve it follow those steps in this web site |
Fixed by updating springboot to 3.1.4. The error should be more friendly tough. |
Attempting to compile this under JDK 21 resulted in the following error: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' This error is in the Lombok library and was resolved in v1.18.30: projectlombok/lombok#3393 This project uses the latest version of Lombok which is compatible with JDK 21, however it also uses Spring Boot which has its own dependency which is to a specific version of JDK. This patch updates the version of Lombok specified to be the minimum version supported by JDK 21. The result compiles, but I have not done significant testing of the result (yet) to ensure there are no latent issues. Related Stack Overflow discussion: https://stackoverflow.com/questions/77171270/compilation-error-after-upgrading-to-jdk-21-nosuchfielderror-jcimport-does-n
] Attempting to compile this under JDK 21 resulted in the following error: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' This error is in the Lombok library and was resolved in v1.18.30: projectlombok/lombok#3393 This project uses the latest version of Lombok which is compatible with JDK 21, however it also uses Spring Boot which has its own dependency which is to a specific version of JDK. This patch updates the version of Lombok specified to be the minimum version supported by JDK 21. The result compiles, but I have not done significant testing of the result (yet) to ensure there are no latent issues. Related Stack Overflow discussion: https://stackoverflow.com/questions/77171270/compilation-error-after-upgrading-to-jdk-21-nosuchfielderror-jcimport-does-n
Attempting to compile this under JDK 21 resulted in the following error: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' This error is in the Lombok library and was resolved in v1.18.30: projectlombok/lombok#3393 This project uses the latest version of Lombok which is compatible with JDK 21, however it also uses Spring Boot which has its own dependency which is to a specific version of JDK. This patch updates the version of Lombok specified to be the minimum version supported by JDK 21. The result compiles, but I have not done significant testing of the result (yet) to ensure there are no latent issues. Related Stack Overflow discussion: https://stackoverflow.com/questions/77171270/compilation-error-after-upgrading-to-jdk-21-nosuchfielderror-jcimport-does-n
There is error during compilation while running under JDK21: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' Following advice from projectlombok/lombok#3393 seems to fix the issue Signed-off-by: Richard Kosegi <richard.kosegi@gmail.com>
There is error during compilation while running under JDK21: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' Following advice from projectlombok/lombok#3393 seems to fix the issue Signed-off-by: Richard Kosegi <richard.kosegi@gmail.com>
|
//getting these below error while running above code java: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' |
Getting this error |
Describe the bug
Lombok 1.8.26 does not work with JDK21 (EA build 16)
To Reproduce
will fail with this error:
Expected behavior
Lombok should work with JDK21
Version info:
The text was updated successfully, but these errors were encountered: