3

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 :(

D P
  • 41
  • 1
  • 3
  • There was a bug in Idea which caused the compilation to fail due to plugins. I can't find it on their issue tracker, but one of the solutions to solve it is to reset Idea to default settings. – Alexiy Jun 08 '20 at 09:08
  • @Alexiy thanks I will try that. Do you know if there's any specific way to do this? I can try resetting settings or even uninstalling but I'm afraid it'll just end up in the same spot again – D P Jun 08 '20 at 11:18

3 Answers3

1

@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

D P
  • 41
  • 1
  • 3
1

if you are using java version 11, try to change using java version 8. I worked this way

ruriazz
  • 9
  • 1
0

Looks like processing of annotation is turned off. You can enable it by checking this setting:

File -> Setting -> Compiler -> Annotation Processors -> Enable annotation processing

libanbn
  • 272
  • 2
  • 8
  • Unfortunately like I've mentioned in my post this is one of the most popular answers on stackoverflow and I've already done that. I already have it working on a Mac, following these instructions. So it might be something window specific – D P Jun 08 '20 at 11:17