Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » All Java 8 classes opened in 2021-13 fail with Java 9 related error, but perhaps caused by Java 16
All Java 8 classes opened in 2021-13 fail with Java 9 related error, but perhaps caused by Java 16 [message #1839391] Fri, 19 March 2021 18:20 Go to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 727
Registered: July 2009
Senior Member
I've been using 2020-12 since its release with many Java 8 projects. I've been running it with Java 15, but the projects are using the Java 8 JDK. This has been working fine.

I just started setting up 2021-03 today. I set it to run with Java 16. I exported my preferences from the 2020-12 workspace and imported that into the new 2021-03 workspace. I installed all the plugins I normally use.

I then imported all of the projects I need from my git repositories.

When the dust settled, I saw that any attempt to open a Java class failed with the same error:

Quote:
java.lang.reflect.InaccessibleObjectException: 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 @18cf5c52


I'm also seeing a slew of dialogs titled "Multiple problems have occurred", saying "Errors occurred during the build", all repeating that same error message. It got to the point that this dialog would come up as fast as I could dismiss it, as projects seemed like they were in a build loop.

The other oddity is that most of the Java projects had a single compile error, saying that "The project cannot be built until its prerequisite xxxx is built. Cleaning and building all projects is recommended". All of them report the same project name as needing to be built. The even stranger part is that there doesn't appear to be any problem with that project. It has no errors.

At that point, I exited Eclipse. I changed the eclipse.ini file to run it with Java 15. I started it back up. Everything compiled fine. I'm going to move forward with Java 15 for now.
Re: All Java 8 classes opened in 2021-13 fail with Java 9 related error, but perhaps caused by Java [message #1839394 is a reply to message #1839391] Fri, 19 March 2021 19:28 Go to previous messageGo to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 86
Registered: October 2018
Member
Hi.

Not sure that this will help....

2021-03 does not come out of the box with Java 16 support.

Have you installed Java 16 Support for Eclipse 2021-03 (4.19) ?

https://marketplace.eclipse.org/content/java-16-support-eclipse-2021-03-419

Regards.





Re: All Java 8 classes opened in 2021-13 fail with Java 9 related error, but perhaps caused by Java [message #1839396 is a reply to message #1839394] Fri, 19 March 2021 19:57 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 727
Registered: July 2009
Senior Member
I hadn't before this point. I guess I assumed it didn't matter if I was only using Java 16 to run Eclipse, not for projects.

However, I can't even install it. It chugs for quite a while, saying "Cannot perform operation", and finally fails with an error dialog saying "Problems occurred while performing provisioning operation: operation plan must be resolved
operation plan must be resolved". Here's the error log stacktrace:

!ENTRY org.eclipse.epp.mpc.ui 4 0 2021-03-19 12:53:39.853
!MESSAGE Problems occurred while performing provisioning operation: operation plan must be resolved
!STACK 0
java.lang.IllegalStateException: operation plan must be resolved
	at org.eclipse.equinox.internal.p2.ui.ProvUI.toCurrentJREOperation(ProvUI.java:338)
	at org.eclipse.equinox.internal.p2.ui.ProvUI.toCompabilityWithCurrentJREProvisioningPlan(ProvUI.java:325)
	at org.eclipse.epp.internal.mpc.ui.wizards.MarketplaceWizard.lambda$5(MarketplaceWizard.java:876)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)


I wonder if this particular error is happening because I'm not actually running Eclipse with Java 16 right now. It's using Java 15.
Re: All Java 8 classes opened in 2021-13 fail with Java 9 related error, but perhaps caused by Java [message #1839407 is a reply to message #1839396] Sat, 20 March 2021 06:22 Go to previous messageGo to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 86
Registered: October 2018
Member
Hi,

Eclipse now includes a JRE.

index.php/fa/40181/0/

Fresh unzip of eclipse-java-2021-03-R-win32-x86_64.zip and fresh work space.

This is my eclipse.ini :

index.php/fa/40182/0/

I installed Java 16 Support for Eclipse 2021-03 (4.19).

Later I add java 16 manually (openjdk-16_windows-x64_bin.zip):

index.php/fa/40183/0/

In the project I change the pom.xml and alt-F5 to update the project.

index.php/fa/40184/0/

The result:

index.php/fa/40185/0/

Your environment is much more complex than mine but since you use java 15 now I am not so sure that the problems relate to modules(java 9 stuff...).

Regards.
Eitan.
Re: All Java 8 classes opened in 2021-13 fail with Java 9 related error, but perhaps caused by Java [message #1839417 is a reply to message #1839407] Sat, 20 March 2021 15:39 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 727
Registered: July 2009
Senior Member
When I referred to "Java 9", I should have referred to "modules", as the error message specifically mentioned that.

I'm aware of the fact that this version comes with a JRE. I chose not to use it, not because I saw any problem with using it, I was just used to specifying my own installation. I'm not aware of any information that indicates the embedded JRE is the one that should or must be used.

Note that I am building projects with Java 8. This issue of mine is only with the JVM used to run Eclipse.
Re: All Java 8 classes opened in 2021-13 fail with Java 9 related error, but perhaps caused by Java [message #1839418 is a reply to message #1839417] Sat, 20 March 2021 16:31 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7165
Registered: July 2009
Senior Member
Hi

An increasing number of platform plugins have moved to Java 11, so the Eclipse IDE is now unusable with a Java 8 JVM. You may however still use the IDE to develop Java 8 and indeed Java 5 applications. You will find that many non-UI plugins retain a much lower BREE. The movement to Java 11 seems to be widespread so there is little point in the Eclipse IDE sticking at Java 8 when the world is moving on.

Regards

Ed Willink
Re: All Java 8 classes opened in 2021-13 fail with Java 9 related error, but perhaps caused by Java [message #1839419 is a reply to message #1839418] Sat, 20 March 2021 18:42 Go to previous message
David M. Karr is currently offline David M. KarrFriend
Messages: 727
Registered: July 2009
Senior Member
You didn't need to convince me. It's not as if this was my choice. I occasionally throw the "when are we going to upgrade our JVM?" question up the pole to see how high it goes before it falls down again. So many orgs embrace "if it's not broken, don't fix it", without any consideration of unseen consequences.
Previous Topic:Java Compliance Level keeps reseting to 1.8 after restart
Next Topic:Error: Could not find or load main class Caused by: java.lang.ClassNotFoundException:
Goto Forum:
  


Current Time: Wed Jun 16 02:54:19 GMT 2021

Powered by FUDForum. Page generated in 0.02081 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top