177

After upgrade, Unable to run the application from intellij IDE.

Intellij version : IntelliJ IDEA 2020.3 (Community Edition) Build #IC-203.5981.155, built on December 1, 2020

lombok version : 0.32-EAP

Error :

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.$Proxy24
  Lombok supports: sun/apple javac 1.6, ECJ
Spartan
  • 3,213
  • 6
  • 26
  • 31
  • 1
    Did you check https://github.com/rzwitserloot/lombok/issues/2592? Does updating to the latest Lombok version help? – CrazyCoder Dec 03 '20 at 18:06
  • for me lombok plugin version is. 0.32-EAP. no updates after that? – Spartan Dec 04 '20 at 02:24
  • You are mixing up Lombok IntelliJ IDEA plug-in and Lombok dependency used in your project. These two are completely unrelated. You need to update the latter. – CrazyCoder Dec 04 '20 at 02:26
  • 1
    Related bug report for IDEA: https://youtrack.jetbrains.com/issue/IDEA-252069 – dmitryb Dec 29 '20 at 13:47
  • Same issue with version 2021.1, Build #IU-211.6693.111. Hopefully, solved with the accepted answer. – dZ. Apr 23 '21 at 13:43

20 Answers20

358

Using lombok 1.18.16 did not work for me. I added the argument below in the build process VM options in

-Djps.track.ap.dependencies=false

Setting:-

Build, Execution, Deployment -> Compiler -> Shared build process VM options

and it worked https://github.com/rzwitserloot/lombok/issues/2592

Naman
  • 27,789
  • 26
  • 218
  • 353
Bash
  • 4,140
  • 1
  • 13
  • 8
78

This issue is introduced in IntelliJ IDEA 2020.3 (Community Edition) Build #IC-203.5981.155.

You can fix it by adding this dependency into your project -

Maven -


<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.16</version>
    <scope>provided</scope>
</dependency>

Gradle -

providedCompile group: 'org.projectlombok', name: 'lombok', version: '1.18.16'
Amit Dusane
  • 1,324
  • 10
  • 12
  • added this in pom file in a spring boot project, says 1.18.16 is not found – Ruby9191 Dec 09 '20 at 03:22
  • 2
    unchecked the Lombok IntelliJ plugin then did maven menu->reload project from within IntelliJ after adding 1.18.16 version in pom file, then it worked – Ruby9191 Dec 09 '20 at 03:40
  • This didn't fix the issue at once on our multi-module project. I installed the root pom first (which declares lombok.version property) so that IntelliJ would use the right lombok dependency to build, disabled IntelliJ Lombok plugin, restarted and ran mvn idea:idea to get a successful build Not sure what actually fixed the workspace, I'll update this comment as other teammates will run through this. – Alexis LEGROS Dec 10 '20 at 14:37
  • 1
    Worked after "Reload All Maven Projects", no disabling Lombok plugin or restarting IntelliJ needed. – tobias_k Dec 17 '20 at 14:56
  • Thanks! @Amit Spent a lot of time changing the intelliJ settings like Annotation Processor, Plugin Registry. – manikanta nvsr Dec 30 '20 at 08:50
  • 1
    It's not ideal to have to change your project because of an upgrade in your IDEA. In a lot of cases, you can't even do that. I think the other solution with `-Djps.track.ap.dependencies=false` is better, until you are able to upgrade your dependencies to that lombok version. – Didier L Dec 30 '20 at 15:59
  • 1
    update lombok version, mvn idea:idea and mvn clean:install did it. thx @AlexisLEGROS – ugurkocak1980 Jan 18 '21 at 10:18
  • Arf, can't update my comment anymore! As @ugurkocak1980 mentionned, lombok version update + `mvn idea:idea clean install` seem to get your build back on track – Alexis LEGROS Feb 03 '21 at 09:49
  • This did not work for me. Also, even if it did it would not be acceptable to tell the entire team that they have to do this in order to get the projects operational. This is a barrier to roll out Lombok to the team. – Thomas Beauvais Feb 24 '22 at 13:38
77

For the impatient one (like myself) add

-Djps.track.ap.dependencies=false

to 'Shared build process VM options:'

enter image description here

Pankaj
  • 2,220
  • 1
  • 19
  • 31
19

I had the same issue here after updating my Intellij Community to 20.3. The issue could be solved by updating the lombok plugin to 1.18.16

VisualDigits
  • 191
  • 2
  • i dint get any update from Intellij n lombok after the above metioned version. – Spartan Dec 04 '20 at 02:25
  • @Thanga You are mixing up Lombok IntelliJ IDEA plug-in and Lombok dependency used in your project. These two are completely unrelated. You need to update the latter. – CrazyCoder Dec 04 '20 at 02:27
  • @CrazyCoder oh ok..I thought this issue is occurring because of intellij-lombok-plugin. Can we update lombok in project just for IDE issue? – Spartan Dec 04 '20 at 02:47
  • 1
    This one fixed it for me - no custom VM options required. Went from `1.18.6` to `1.18.24` – takanuva15 Aug 04 '22 at 17:20
11

Perform this steps to resolve this issue -->

  1. Click on IntelliJ Idea near File Menu from header
  2. Open Preferences
  3. Click on Build, Execution, Deployment
  4. Go to Compile
  5. Inside the User-local build process VM options -> Add this command -Djps.track.ap.dependencies=false
  6. Apply the changes
CodingBee
  • 1,011
  • 11
  • 8
6

Intellij CE Version: 2020.3 Lombok issue fixed by simply updating POM dependency. Example,

<dependency>
  <groupId>org.projectlombok</groupId>
  <artifactId>lombok</artifactId>
  <version>1.18.16</version>
</dependency>
Bharathi
  • 69
  • 2
5

With this version:

  • Version: 2020.3
  • Build: 203.5981.155
  • 1 December 2020

I've got this message:

⚠ You aren't using a compiler supported by lombok, so lombok will not work and has been disabled


So,

I added lombok plugin in IntelliJ:

install lombok plugin

I enabled it: enter image description here

I downloaded the last lombok Jar: https://projectlombok.org/downloads/lombok.jar

And installed it manually: download lombok jar

Add it in Platform settings add lombok jar in platform settings

And, now, it works fine!


PS: The version of my project Lombok dependency is 1.18.8 while the one of the downloaded plugin installed jar in platform settings is 1.18.16.

vvauban
  • 165
  • 4
  • 8
4
  • Go to IntelliJ | Preferences | Build, Execution, Deployment |
  • Compiler Find Build process VM options or Shared build process VM
  • options Add string -Djps.track.ap.dependencies=false into the text
  • box Hit save
2

Another cause could be that you updated the lombok version and forgot to update the version of the lombok plugin:

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.20</version>
    <scope>provided</scope>
</dependency>
<!-- needs to match -->
<plugin>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok-maven-plugin</artifactId>
    <version>1.18.20.0</version>
<!-- [...] plugin config -->
</plugin>
serv-inc
  • 35,772
  • 9
  • 166
  • 188
1

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.$Proxy27 Lombok supports: sun/apple javac 1.6, ECJ

Upgrade your lombok version by adding below dependencies for gradle, as this is the version supported by updated Intellij 2020.3:

compileOnly 'org.projectlombok:lombok:1.18.16'
annotationProcessor 'org.projectlombok:lombok:1.18.16'
1

In my case, I had a dependency module running in the project that used another version of lombok. Another spring-boot version to be more precise. With it's BOM comes another lombok version.

version warning

Huub
  • 91
  • 5
1

My project has lombok in version 1.18.16 yet intellij 2020.3 refused to compile my code and above answers did not help:(.

Eventually tweeking in settings->"build,execution,deployment"->compiler->"annotation processors" worked :). Make sure to enable "annotation processing" and "obtain processors from classpath" checkboxes .

screenshot

Saginatio
  • 99
  • 4
1

Solved it by using the maven-compiler-plugin configuration and specify the annotationProcessorPaths as follows:

Note I also have mapstruct, so hence the extra paths.

inside build/plugins:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <annotationProcessorPaths>
            <path>
              <groupId>org.projectlombok</groupId>
              <artifactId>lombok</artifactId>
              <version>${lombok.version}</version>
            </path>
            <path>
              <groupId>org.projectlombok</groupId>
              <artifactId>lombok-mapstruct-binding</artifactId>
              <version>${mapstruct-processor.version}</version>
            </path>
            <path>
              <groupId>org.mapstruct</groupId>
              <artifactId>mapstruct-processor</artifactId>
              <version>${mapstruct.version}</version>
            </path>
          </annotationProcessorPaths>
        </configuration>
      </plugin>

My dependencies:

    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.mapstruct</groupId>
      <artifactId>mapstruct</artifactId>
      <version>${mapstruct.version}</version>
    </dependency>

My properties:

    <java.version>11</java.version>
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <mapstruct.version>1.4.2.Final</mapstruct.version>
    <mapstruct-processor.version>0.2.0</mapstruct-processor.version>
    <!-- Bumped version of lombok temporarily to avoid issues with IntelliJ 2020.3+ until we have upgraded to a more recent version of spring boot. -->
    <lombok.version>1.18.20</lombok.version>

Note: I override the lombok version to 1.18.20 since I'm still on an older version of spring boot which uses 1.18.12 under the hood...

BitfulByte
  • 4,117
  • 1
  • 30
  • 40
  • 1
    Using Intellij version 2021.1.3 Ultimate the solution "-Djps.track.ap.dependencies=false" did not work nor did merely adding a explicit lombok dependency in the pom file. However adding the element to the maven compiler plugin along with adding a lombok dependency did work. – James W Jul 23 '21 at 21:40
  • Yeah I didn't use `Djps.track.ap.dependencies` either. – BitfulByte Jul 25 '21 at 20:23
1

I had the same error and I solved updating IntelliJ to 2021.1.1 version: IntelliJ IDEA 2021.1.1 (Community Edition) Build #IC-211.7142.45, built on April 30, 2021

Rodrigo
  • 11
  • 1
0

For me, I disabled the bundled Lombok plugin. Then enabled it again and reloaded the maven project. Boomshakalaka.

Lombok 1.18.22

IDEA 2021.3 #IU-213.5744.223

0

Somehow I couldn't make it work no matter what options I tried in the settings. I finally managed to make it work by following the bare instructions on lombok with ecj page. I downloaded lombok.jar and added this in the Shared build process VM options :

-Djps.track.ap.dependencies=false -javaagent:/path/to/lombok/jar/lombok.jar=ECJ

This was using this system :

IntelliJ IDEA 2022.1.4 (Ultimate Edition)

Build #IU-221.6008.13, built on July 19, 2022

Macbook pro with a M1 pro

jebeaudet
  • 1,533
  • 16
  • 15
0

add scope as provided <scope>provided</scope>.

This will not give any issues on compile time

0

In my case, I was running code with mapstruct and forgot to compile. When IntelliJ builds and tries to run, that error shows.

After running mvn clean install -U through Windows prompt and clicking button Reload All Maven Projects, the project runs correctly. enter image description here

Matheus Santz
  • 538
  • 6
  • 7
0

I had the same problem with jetbrains 2023.2. I had a lombok version 1.18.22. First i needed to deprecate to 1.18.20 and build it. After that I rebuild it with 1.18.22 and works like a charm. Maybe intellj can not autodetect the version diff with lombok plugin...It's just a hint, but this was the only way I can fix it...

-3

You need to enable the bundled plugin.

Since version 2020.3 the Lombok plugin is build-in, you don't need to download a separate plugin (which won't work anymore). Find it in installed plugins (not in marketplace) and simply enable it.

it's bundled1

That plugin doesn't have homepage link anymore and has a different description.

new plugin description

Wojciech Beling
  • 438
  • 3
  • 6