javaeclipsejava-17eclipse-2021-09openjdk-17

Eclipse not able to open java files -> Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass


Getting the following error, after adding Lombok lib

An error has occurred. See error log for more details.
Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @1d1c37d5

Solution

  • Add the below lines to the end of the eclipse.ini file

    --illegal-access=warn
    --add-opens=java.base/java.lang=ALL-UNNAMED