close

[Solved] java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment

Hello Guys, How are you all? Hope You all Are Fine. Today I am using Lombok Plugin to automate getter setter But I am facing the following error java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment in java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment Error Occurs ?

Today I am using Lombok Plugin to automate getter setter But I am facing the following error.

java: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x3b67ef9b) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x3b67ef9b

How To Solve java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment Error ?

  1. How To Solve java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment Error?

    To Solve java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment Error To solve this error Switch to at least the 1.18.20 version of Lombok. Second solution is to In my case, I was still getting the error with this version (1.18.20) and Java 16. It disappears when I downgrade to Java 15

  2. java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment

    To Solve java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment Error To solve this error Switch to at least the 1.18.20 version of Lombok. Second solution is to In my case, I was still getting the error with this version (1.18.20) and Java 16. It disappears when I downgrade to Java 15

Solution 1: Update Lombok

To solve this error Switch to at least the 1.18.20 version of Lombok

<dependency>
  <groupId>org.projectlombok</groupId>
  <artifactId>lombok</artifactId>
  <version>1.18.20</version>
</dependency>

Solution 2: Downgrade to java 15

In my case, I was still getting the error with this version (1.18.20) and Java 16. It disappears when I downgrade to Java 15

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment