Eclipse 2021-06, Lombok 1.18.20 and Java 8

2,515 views
Skip to first unread message

Scott Warner

unread,
Jul 22, 2021, 11:04:08 AM7/22/21
to Project Lombok
I am getting the following exception in the eclipse editor window when I try to open a class:

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 @2154652c

This is occurring with:
eclipe eclipse-jee-2021-06-R-win32-x86_64.zip
java project jre: AdoptOpenJDK jdk8u292-b10
lombok: 1.18.20

If lombok is not installed, I don't have any problems.  Does anyone have any suggestions?  I haven't seen any messages about this in the lombok issues or  discussions and I haven't found anything in the eclipse bugs or discussions.

I downloaded and unzipped eclipse-jee-2021-06-R-win32-x86_64.zip, installed lombok 1.18.20 using the gui and then started it up.  In the preferences, I changed the project installed jre to AdoptOpenJDK jdk8u292-b10.  I then created a basic java project and added a new class to it.  The error shows up in the editor pane.

Hubert Baumeister

unread,
Sep 23, 2021, 4:54:31 AM9/23/21
to Project Lombok
I have observed the same with temurin-16 on Mac OS and the jee version of Eclipse 2021-06. The mentioned error message appears, and the code editors would not open. Uninstalling Lombok stopped the error message and code editors open again.

Lombok does not have the same problem with Eclipse 2020-12.

Rawi

unread,
Sep 23, 2021, 12:42:12 PM9/23/21
to Project Lombok
There is a list of workarounds in #2810. The easiest one is to use the edge version. The eclipse package you downloaded uses a bundled JDK16 where it is no longer possible to use ClassLoader.defineClass without changes. Changing the used JDK on your project only changes the version the internal compiler uses but does not change the java version used to start eclipse.
Reply all
Reply to author
Forward
0 new messages