Reputation: 41
IntelliJ Community 2020.1, Windows 10. I added Lombok plugin, I added the dependency to my maven pom.xml, and I enabled annotation processing. IntelliJ editor shows auto complete for lombok annotated methods, and shows 0 errors. But it won't compile and keeps throwing out
Error:(3, 14) java: package lombok does not exist
Error:(10, 6) java: cannot find symbol
symbol: class Data
I have tried JDK1.8.0_162, Correto-1.8._252, and OpenJDK-14.0.1
Now doing exactly this works on my Mac. This issue is specifically isolated to windows. I haven't done much Java on Windows before. I've gone into IntelliJ and hit the checkbox for the lombok jar for my project, but when I try to build IntelliJ can't ever find the jar. I've tried every google result I can find
Is there something on windows/my class path/my build I need to allow it to find the jar? I tried adding my jar to VM options like this -javaagent:"C:\Users\d\.m2\repository\org\projectlombok\lombok\1.18.12\lombok-1.18.12.jar"
Please don't mark this as a duplicate this is different as the only fixes are using gradle, or don't fix it for windows. I spent 6 hours looking for an answer and none of the fixes were for windows :(
Upvotes: 3
Views: 8148
Reputation: 56
On my Mac (IntelliJ Idea 2024.1.3 Ultimate), after importing a project from existing directory I also faced the same error: 'package lombok does not exist'
Performing 'Reload Project' on the pom.xml file fixed it for me.
Right-click on pom.xml > Maven > Reload Project
Upvotes: 0
Reputation: 11
if you are using java version 11, try to change using java version 8. I worked this way
Upvotes: 1
Reputation: 41
@Alexiy's answer here fixed it Windows 10 Java - package lombok does not exist
I just followed these instructions https://www.jetbrains.com/help/idea/configuring-project-and-ide-settings.html
I had to reset IntelliJ settings, reinstall Lombok plugin, reselect my JDK, and it worked, thank you! I spent hours trying to find a fix
Upvotes: 1
Reputation: 270
Looks like processing of annotation is turned off. You can enable it by checking this setting:
File -> Setting -> Compiler -> Annotation Processors -> Enable annotation processing
Upvotes: 0