java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor cannot access class


I am somewhat new to coding and am trying to use the Lombok plugin to automatically create Getters/Setters e.t.c. for my fields of a specific class. In doing so I get greeted with the following error:

The error:

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

After doing some searching online, I found out that this error is related to an issue in OpenJDK 15 but I am currently using OpenJDK 16, hence why I am confused that I am still getting this error.

This thread claims to have a solution: but after implementing the plugin, it does not seem to make any difference and I still receive the error.

I have most likely made a trivial mistake since I am a beginner but if someone knows what I am missing please let me know.

Class Using @Data (Lombok):

import lombok.Data;

public class Ingredient {

    private final String id;
    private final String name;
    private final Type type;

    public enum Type {


My Pom File:

<project xmlns="" xmlns:xsi=""
        <relativePath/> <!-- lookup parent from repository -->
    <description>Taco Cloud Project</description>





Switch to at least the 1.18.22 version of Lombok that contains the fix


To see the last version of lombok, follow this link on


Leave a Reply

Your email address will not be published. Required fields are marked *