Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Error: LinkageError occurred while loading main class (Problems Downgrading JDK)
Error: LinkageError occurred while loading main class [message #1826170] Mon, 20 April 2020 15:22 Go to next message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
Developing a desktop app for Windows and Linux. Installed JDK14 on Windows and then found nightmare trying to install that on Linux. Linux supported version is JDK11.

So, found installer for JDK11 for Windows. Eclipse Already installed and project built in JDK14 on Windows. So. Eclipse won't run after "downgrade".
So, Eclipse not in Windows list of installed programs.
So run Eclipse installer for again.
After a lot of fiddling, Eclipse is running. So add Window Builder again.
So, begin fixing up project settings for JDK11 rather than 14. Mostly this is working

BUT

Closed Eclipse and then it won't run again. Says there is no JDK14? Huh? I just did reinstall. So FREAKING Manually Edit the Eclipse.ini file and find reference to JDK14 as the VM for the whole freaking thing? Huh? Installer did not fix that. And how did it ever run. JDK14 is GONE from system. So Manually Edit the Eclipse.ini file to point to JDK 11.

At this point I have considered Wiping the system disk and starting over, but seriously. Shouldn't the Installer rewrite the INI file? Ok so

I'm still getting this when I try to run the program:

Error: LinkageError occurred while loading main class com.ww.appcode.ShowRunnerEvents
	java.lang.UnsupportedClassVersionError: com/ww/appcode/ShowRunnerEvents has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 55.0


Project settings - all things I can find have been set to JDK11.
So, Project Clean FAIL
Uncheck Build Automatically
Build All
Delete .class files manually from the offending package
Clean All
Build All
And still these same errors

So What's the answer so I can get back to work.
BTW, this is the whole reason that I'm doing this. JDK14 yada yada yada JDK11 as above is the reason that I needed to downgrade Windows install from JDK14 to JDK11 since Linux supports JDK11 not JDK14.

And Yes, I tried to install JDK14 on Linux and that failed so badly that I had to completely rebuild the Linux VM system from scratch - build a brand new one from a brand new VDI hard drive. Yep Hosed that badly.

So long and whining story later.

Please, how can I fix this error. Even manually deleting the class files does not help.
Thanks.

[Updated on: Mon, 20 April 2020 15:25]

Report message to a moderator

Re: Error: LinkageError occurred while loading main class [message #1826173 is a reply to message #1826170] Mon, 20 April 2020 15:35 Go to previous messageGo to next message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
Sorry for the tirade, but now I've found it: I spent an hour working on before I posted this: But now I found this:

https://stackoverflow.com/questions/11350733/how-do-i-convert-my-eclipse-project-to-an-earlier-java-version

And it mentions setting the Java Compiler. For some reason, Eclipse was still stuck on JDK13 when that was not even installed on system.
But when I changed that to JDK11 and said YES to "Full Rebulid" prompt, things are actually working now.

So take away:

(1) Downgrading Java version is a nightmare. So many things to fix separately. Even when you set each to default for all projects.

(2) Eclipse Installer does not re-write the Eclipse.INI file to the correct version of Java if you are downgrading. Gotta do this manually by editing this file.

Ok. Marked SOLVED whereever that is.
Thanks to Google Search for eventually finding the answer.
Re: Error: LinkageError occurred while loading main class [message #1826177 is a reply to message #1826173] Mon, 20 April 2020 16:10 Go to previous messageGo to next message
Windy Player is currently offline Windy PlayerFriend
Messages: 17
Registered: April 2020
Junior Member
Oh, Wait. Could I have left JDK14 installed on windows and then just asked Eclipse to use JDK11 to build and run the project? Because JDK11 is still there in JDK14? I guess one would expect a JDK to be backward compatible.

That sure would have been much easier.
Oh well. Live and learn. I wonder if upgrading back to JDK14 or 16 or whatever will be a issue. What do I have to do to fix Eclipse? Edit INI files? Run installers? Another day. Problem for the future.
Re: Error: LinkageError occurred while loading main class [message #1827626 is a reply to message #1826177] Tue, 19 May 2020 13:51 Go to previous message
HARIKEVAL KUSHWAHA is currently offline HARIKEVAL KUSHWAHAFriend
Messages: 1
Registered: May 2020
Junior Member
Change Compiler compliance level from 12 to 11
  • Attachment: Capture.JPG
    (Size: 99.22KB, Downloaded 67 times)
Previous Topic:Eclipse 2020-03 freezes during start (log4j:WARN)
Next Topic:Maven updating indexes never ends
Goto Forum:
  


Current Time: Sun Nov 29 12:15:59 GMT 2020

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

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

Back to the top