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

Viewed 85433

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
17 Answers

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

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'

For the impatient one (like myself) add

-Djps.track.ap.dependencies=false

to 'Shared build process VM options:'

enter image description here

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

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

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>

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.

  • 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

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'

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

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

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...

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

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

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>

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

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

Related