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 ?
- How To Solve java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment Error ?
- Solution 1: Update Lombok
- Solution 2: Downgrade to java 15
- Summery
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 ?
- 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
- 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
That’s it! I recently switched from JDK 14 to 17 and had the problem described here.
This solution solves it.
Thanks. Any way this will work in future for JDK 17? I presume it’s a Lombok issue that they need to fix in next version?
Thank you so much for sharing
It’s my Pleasure to Help You, James. Thank You For Your Valuable words ❤️.