The project builds and runs successfully via command line, but if I want to build/launch the debugger via Intellij, the lombok @Builder seems not to be recognized:
java: cannot find symbol
symbol: class MyClassBuilder
location: class com.xxx.MyClass
package com.xxx;
import lombok.Builder;
@Builder
public class MyClass {
//code
}
- I have lombok plugin
- I have enabled annotation processing
- I have selected Obtain processors from project class path
- I have tried several debug config changes, invalidate intellij cache/restart but no luck
The project builds and runs successfully via command line, but if I want to build/launch the debugger via Intellij, the lombok @Builder seems not to be recognized:
java: cannot find symbol
symbol: class MyClassBuilder
location: class com.xxx.MyClass
package com.xxx;
import lombok.Builder;
@Builder
public class MyClass {
//code
}
- I have lombok plugin
- I have enabled annotation processing
- I have selected Obtain processors from project class path
- I have tried several debug config changes, invalidate intellij cache/restart but no luck
2 Answers
Reset to default 0The workaround is described in below answer on intellij forum
https://intellij-support.jetbrains.com/hc/en-us/community/posts/23064675521682/comments/23204746556050
as answer is suggesting to include
<version>${lombok.version}</version>
against lombok annotation processor configuration in your pom.xml.
Above solution worked for me!
Solution: IntelliJ Project SDK was setup as java 23; however the build in command line was using java 17 I changed the SDK in IntelliJ project struct to java 17 and the issue got resolved