Incorrect java version - "java.lang.UnsupportedClassVersionError"

OS Name/Version: 18.04.1-Ubuntu

Product Name/Version: AMP Instance Manager v2.3.2 built 31/01/2022

Problem Description:
Unable to manage instances in ADS. Error about Java class version.

[14:55:30] [Core Info]            : Checking for AMP updates...
[14:55:30] [Minecraft Info]       : Java located at /usr/java/jre1.8.0_321/bin/java
[14:55:31] [Minecraft Info]       : Using 'Official' compatibility mode.
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "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 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)
[14:55:31] [Minecraft Warning]    : Server failed to start 1/5 times...
[14:55:31] [Minecraft Warning]    : Server stopped within 5 seconds of starting, AMP will not attempt to restart it.
[14:55:31] [Core Info]            : AMP is up-to-date.

Steps to reproduce:

  • Unkown

Actions taken to resolve so far:
Uninstalled all version of Java and manually installed latest.

AMP@:~/.ampdata/instances/Minecraft01/AMP_Logs$ which java
/usr/java/jre1.8.0_321/bin/java
AMP@:~/.ampdata/instances/Minecraft01/AMP_Logs$ java -version
java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)

Have you changed the setting in AMP to control which version of Java it should use?

I’m not familiar with that setting. Where can I find it?

Type β€œJava” into the top right search box in your Minecraft instance.

If I type Java in the search box, the dropdown panel doesn’t display properly. Other searches seem to work fine.

image

From what i can see in the screenshot, thats the ADS instance. Connect into the minecraft instance and then search for β€œJava”

Nice catch! Thank you.

EDIT:
Thanks to Ashlyne I realized that that instance was bound to 127.0.0.1. I rebound it to 0.0.0.0:8083 and was able to see the java options for that instance. This led to me checking a few other things and enabled me to check the Java version. I realized that I was using JRE1.8 and not JDK 1.17… afer installing the JDK and setting JAVA_HOME to it (and rebooting) things are working and I’m able to log in. Thanks for all of the help. I’m good to go now.

:EDIT

Instance information is below. Connections to the server on port 8081 gets connection refused. Logs for that instance are also included below. It shows the webserver starting on the expected port of 8081 which gets connection refused.

I’m considering just reinstalling everything from nothing but I kind of feel like I’m getting close to getting this sorted out and don’t want to break anything.

Instance Information:

AMP@jinksto:~$  /opt/cubecoders/amp/ampinstmgr --ShowInstancesList
[Info] AMP Instance Manager v2.3.2 built 31/01/2022 18:03
[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
Instance ID        β”‚ 7a741d07-9b94-4bb2-996d-5a4b6a6ab5e5
Module             β”‚ ADS
Instance Name      β”‚ ADS01
Friendly Name      β”‚ ADS01
URL                β”‚ http://127.0.0.1:8080/
Running            β”‚ Yes
Runs in Container  β”‚ No
Runs as Shared     β”‚ No
Start on Boot      β”‚ Yes
AMP Version        β”‚ 2.3.2.0
Release Stream     β”‚ Mainline
Data Path          β”‚ /home/AMP/.ampdata/instances/ADS01

Instance ID        β”‚ 5dfd0463-d907-451c-8735-21237ed04006
Module             β”‚ Minecraft
Instance Name      β”‚ Minecraft01
Friendly Name      β”‚ jinksto
URL                β”‚ http://127.0.0.1:8081/
Running            β”‚ No
Runs in Container  β”‚ No
Runs as Shared     β”‚ No
Start on Boot      β”‚ No
AMP Version        β”‚ 2.3.2.0
Release Stream     β”‚ Mainline
Data Path          β”‚ /home/AMP/.ampdata/instances/Minecraft01

AMP_Log for minecraft01 instance:

AMP@jinksto:~/.ampdata/instances/Minecraft01/AMP_Logs$ cat AMPLOG\ 2022-02-05\ 12-35-36.log
[12:35:36] [Core Info]            : Running in a VMware environment.
[12:35:36] [Core Warning]         : Current time zone is set to EST - Servers should ideally be UTC to avoid time-zone related issues
[12:35:36] [Core Info]            : OS: Linux / x86_64
[12:35:36] [Core Info]            : CPU: Intel(R) Xeon(R) CPU X5650 @ 2.67GHz (8C/8T)
[12:35:36] [Core Info]            : AMP Instance ID: 5dfd0463-d907-451c-8735-21237ed04006
[12:35:37] [ModuleLoader Info]    : Loaded MinecraftModule version 1.0.0.3 by CubeCoders Limited
[12:35:37] [Core Info]            : Metrics publishing is enabled at udp://10.0.0.152:12820.
[12:35:37] [ModuleLoader Info]    : Loaded FileManagerPlugin version 1.0.0.0 by CubeCoders Limited
[12:35:37] [ModuleLoader Info]    : Loaded EmailSenderPlugin version 1.0.0.0 by CubeCoders Limited
[12:35:37] [ModuleLoader Info]    : Loaded WebRequestPlugin version 1.0.0.0 by CubeCoders Limited
[12:35:37] [ModuleLoader Info]    : Loaded LocalFileBackupPlugin version 1.0.0.0 by CubeCoders Limited
[12:35:38] [Core Info]            : Licence Present: AMP Professional Edition (Licenced to Tommy Jinks)
[12:35:38] [FileManager Notice]   : Using keypair with fingerprint D1CledVUVBmyDjfzHx89IJFXQR0/bprFehRdab8tB4A=
[12:35:38] [FileManager Info]     : SFTP Server started on 0.0.0.0:2224
[12:35:38] [WebServer Info]       : Websockets are enabled.
[12:35:38] [WebServer Info]       : Webserver started on http://127.0.0.1:8081
[12:35:38] [Logger Warning]       : RouterTimer@10Hz with 2 jobs started
[12:35:38] [Core Info]            : Checking for AMP updates...
[12:35:38] [Minecraft Info]       : Java located at /usr/java/jre1.8.0_321/bin/java
[12:35:39] [Minecraft Info]       : Using 'Official' compatibility mode.
[12:35:39] [Minecraft Warning]    : Server failed to start 1/5 times...
[12:35:39] [Minecraft Warning]    : Server stopped within 5 seconds of starting, AMP will not attempt to restart it.
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "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 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)
[12:35:39] [Core Info]            : AMP is up-to-date.
1 Like

You still have your java set incorrectly for that instance. Pretty sure it will only use the default java when a new instance is created. Old instances will use what they were set to.

Also you said that rebound the ip to 0.0.0.0 but logs show otherwise

Im confused which edit was first :confused:

Edit: nvm. checked the edit log. @Mike we good according to him

Yes, sorry, those were open and close EDIT tags, not two different ones. :slight_smile: Sorry for being confusing. I’m golden now. I was able to update all of my stuff and connect the latest Minecraft client to the server. Thanks for your help.