简体   繁体   English

我可以使用哪个 JDK 版本来支持 Lombok 版本 1.16.16?

[英]Which JDK version can I use to support Lombok version 1.16.16?

I have the following dependency in pom.xml我在 pom.xml 中有以下依赖项

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <optional>true</optional>
    <version>1.16.16</version>
</dependency>

When I run mvn clean install I get the following error:当我运行mvn clean install ,出现以下错误:

Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I found many articles which suggest that I should either upgrade the Lombok version or I should use JDK 8 .我发现很多文章建议我应该升级 Lombok 版本或者我应该使用JDK 8 I am running JDK 8 but still not able to fix this error.我正在运行 JDK 8,但仍然无法修复此错误。 Can someone tell me the exact JDK version that I should use in order to get rid of this error?有人可以告诉我应该使用的确切JDK 版本来消除这个错误吗?

Dependency will help you getting that jar.依赖将帮助您获得那个罐子。 Since Lombok works while code compilation you need to install the Lombok jar由于 Lombok 在代码编译时工作,因此您需要安装 Lombok jar

Refer to this link for installation of Lombok in your IDE请参阅此链接以在您的 IDE 中安装 Lombok

如果您使用 Intellij,则需要安装插件 Lombok

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM