Lombok java: cannot find symbol symbol: method get...()

Lombok annotations are used in the project, and when compiling, it prompts that the set get cannot be found

java: 找不到符号
  符号:   方法 getUserId()
  位置: 类型为com..........model.Users的变量 users

View detailed logs, as follows

java: You aren't using a compiler supported by lombok, so lombok will not work and has been disabled.
  Your processor is: com.sun.proxy.$Proxy26
  Lombok supports: OpenJDK javac, ECJ

It says there is no compiler supported by lombok, so lombok will be disabled and will not work.


Solution:

Method 1: Add configuration to Idea's global configuration Compiler

file -> setting -> build,Execution,deployment -> compiler, shared build process VM options parameters are configured as follows:

-Djps.track.ap.dependencies=false

insert image description here


Method 2: Change the Lombok version

Upgrade the version of lombok to 1.18.14+, mine is changed to the following version normally.

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.24</version>
</dependency>

Guess you like

Origin blog.csdn.net/xch_yang/article/details/130826743