java: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor

Reference:
1. https://www.cnblogs.com/ZZG-GANGAN/p/14789050.html
2. https://www.cjavapy.com/article/1932/
An error occurred when running the java code: java: java .lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor
Environment: IntelliJ IDEA 2021.1.2 x64
problem analysis: JDK version is too high, lombok version is too low
Solution:

1. Upgrade and add version information of lombok

You need to add a line of code to pom.xml. The <version>1.18.12</version>version information needs to be consistent with that on your computer. You can go to maven to upgrade the version and view it.
insert image description here

2. Use jdk1.8

①File---->Project Structure
insert image description here

②Check if there is jdk version 1.8, if so, skip to step ④, if not, you need to download: SDKs----> + ---->Dowload JDK ③Select
insert image description here
version as 1.8, others can be default
insert image description here
④Click to use the corretto-1.8 version of the JDK, first click Apply, then click OK
insert image description here
and finally run the code again, you can succeed, and the level is successful!

Guess you like

Origin blog.csdn.net/lic1697067085/article/details/118512278