Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 357
Thirumal Avatar asked Nov 25 '25 04:11

Thirumal


2 Answers

Updating to Lombok 1.18.22 plugin resulted in this issue going away for me. I did try adding the --add-opens flag, but the eclipse launcher balked at that. IMHO this is simply a result of incompatibility between Java 17 and the Lombok Eclipse IDE plugin.

like image 138
Tod Harter Avatar answered Nov 26 '25 18:11

Tod Harter


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

--illegal-access=warn
--add-opens=java.base/java.lang=ALL-UNNAMED
like image 31
Thirumal Avatar answered Nov 26 '25 18:11

Thirumal