Java program compiled by more recent version of JRE, but I have the most recent version

I'm trying to set up a Minecraft server for my friends and I get the following error every time I try to launch it

Error: LinkageError occurred while loading main class net.minecraft.bundler.Main java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

(copied and pasted)

I have the current JRE available on Ubuntu (build 11.0.15.10). I've tried removing all versions of JRE on my server and reinstalling only the most recent one, but I get the same error. I even updated the whole server from Ubuntu 18 to Ubuntu 20. Any help is much appreciated.

1

1 Answer

from your error you have to know that Java 17 = class file version 61.0 Java 11 = class file version 55.0

So you need to install Java 17. By default Ubuntu have this command sudo apt install default-jre which will install some version of the JRE on your system. Now because you want exactly Java 17 you can try to execute sudo apt install openjdk-17-jre-headless. If this result in error because it is not in the Repository of Ubuntu you can check some tutorial like this to installed it manually:

In your system there is already Java 11. To switch which version you need: sudo update-alternatives --config java The you have to choose the number of the row with the right JVM.

Good luck to all!

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like