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

138.2k views Asked by At

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
20

There are 20 answers

4
Bash On BEST ANSWER

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

4
VisualDigits On

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

0
vvauban On

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.

9
Amit Dusane On

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'
1
Wojciech Beling On

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

0
vanshikamalhotra On

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'
0
Huub On

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

1
Bharathi On

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>
2
BitfulByte On

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

0
Rodrigo On

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

1
CodingBee On

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
0
Rajan Sonvane On

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

This will not give any issues on compile time

0
Saginatio On

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

0
sahil khurana On
  • 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
1
Pankaj On

For the impatient one (like myself) add

-Djps.track.ap.dependencies=false

to 'Shared build process VM options:'

enter image description here

0
enjinerd On

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
jebeaudet On

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

0
László Jóbi On

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

0
serv-inc On

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>
0
Matheus Santz On

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