Configuration with Application Deployment - Cannot run Minecraft 1.21.3 using Java 21

System Information

Field Value
Operating System Linux - Debian GNU/Linux 11 on x86_64
Product AMP ‘Phobos’ v2.6.0.6 (Mainline)
Virtualization QEMU_KVM
Application Application Deployment
Module ADSModule
Running in Container No
Current State Indeterminate

Problem Description

Issue

Pressed Start on brand new Minecraft 1.21.3 instance. Result: Unable to run. Failed immediately. Error message in console:
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 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0

Solution attempt: following instructions from support article How to Change the Java Version on Your Minecraft Server | Hostinger Help Center
Verified which Java version Minecraft 1.21.3 functions with- most sources seem to agree that Java 20 or later is required, which I am assuming is the problem. Navigated to Instances>Manage>Configuration>Minecraft>Java and Memory>Java Version. The options in the java version drop-down are “JAVA 17 (OpenJDK)” “ADOPTOPENJDK 16” “ADOPTOPENJDK 15” “ADOPTOPENJDK 11” “ADOPTOPENJDK 8”. Drop down screenshot in article shows Java 21 as an option, mine does not. Attempted to install Java 21 using “sudo apt install openjdk-21-jre-headles” in the console where the error message was displayed. Currently investigating other possibilities for how the installation should be executed. Please assist.

Reproduction Steps

  • Attempt to launch server
  • Attempt to change to Java 21
  • Java 21 not an option in the drop down

Note, this is just the forum for AMP, we are not associated with Hostinger.
You need to install Java 21. You just have to run getamp installJava as root in the Linux command line. If you are unsure on how to do so, refer to Hostinger’s guides and support.

Thanks for the heads up, I just clicked the create ticket button lol. You may have to bear with me here as I’m not sure what AMP actually is as it differs from Hostinger in the sense that I do not know which questions relate to which product.

TL;DR Took me forever, but I’m 95% sure I’m in the linux command line. I may not be root though, and it seems the commands to make me root might be “not supported”. Basic commands like cd and ls work, but just about nothing else. Any ideas why?

I figured I had to install Java; I’m trying to figure out how to do that. I found a button that said “connect to SFTP” and installed WinSCP on my computer to make the button work. I think the words for what this allows me to do is ‘SSH into the server’? WinSCP has a button that says “open terminal”, and I entered the command you provided there under the current directory “/”, the command failed with return code 127 “command ‘getamp’ not supported”. ‘sudo getamp installJava’, ‘installJava’, ‘sudo -s getamp installJava’, and ‘getamp’ all fail with the same return code and command line prompt that the first word (sudo, getamp, or installJava depending on what I typed) is not supported. I also downloaded PuTTy and opened a session to see if it would work that way, but again received error messages saying the commands were not supported:
Welcome To CubeCoders AMP Embedded SSH
admin@AMP-ADS01:/$ sudo getamp installJava
-sh: Command ‘sudo’ not supported.

When I attempt to enter this command in the interface where I noticed the error message I mentioned in my previous post (a page that I can access after managing the session), it returns the following, with all of the above-mentioned attempts at recombining your prompt:
Unknown or incomplete command, see below for error
sudo getamp installJava<–[HERE]

There is also what appears to be a command line at the bottom of a page titled “deployment log”. Attempting the commands here does nothing; the text just disappears.

In terms of hostinger guides and support (I suspect this is outside the scope of the forum but I’m putting all the information I have out there just in case), this page

indicates that it is possible to run commands, but does not indicate where to run the commands.
This page:

indicates that I was probably on the right path with WinSCP and PuTTY, but does not indicate why the commands would not be supported. I attempted connecting via SSH using the windows command prompt as indicated in the video (slightly different steps) and seem to have connected, but could not log on:
C:\Users\user>ssh -p 2223 sftp://admin@191.101.1.78
(sftp://admin@191.101.1.78) Password:
sftp://admin@191.101.1.78’s password:
Permission denied, please try again.
I attempted both entering my username for the first prompt and password for the second, as well as my password for both prompts, and nether worked.

The following is a few more troubleshooting steps I’ve taken since determining that I probably have figured out how to access the Linux command line:

Clicking on “open terminal” in WinSCP asks if I want to open a separate shell session. “current SFTP-5 session does not support the command you request…” and so on, pretty decent wall of text. Though sudo is not supported, it does let me run at least cd, ls, and pwd. I found a stack overflow post that says I should be able to list all my available commands with compgen, or something to do with creating a function, but nether ‘function’ nor ‘compgen’ are supported.
Same results in PuTTy.
I keep triple checking that I am attempting to do this in the root directory, and it is still the case. Per troubleshooting steps from a StackOverflow post from a guy with a similar issue, I attempted the commands “which sudo” and “echo $PATH”. Results:
admin@AMP-ADS01:/$ which sudo
-sh: Command ‘which’ not supported.
admin@AMP-ADS01:/$ echo $PATH

admin@AMP-ADS01:/$

visudo and su are also not supported:
admin@AMP-ADS01:/$ su
-sh: Command ‘su’ not supported.
admin@AMP-ADS01:/$ visudo
-sh: Command ‘visudo’ not supported.
admin@AMP-ADS01:/$ su -
-sh: Command ‘su’ not supported.

Aight I gotta go. There seems to be some issue with permissions, maybe? If you’ve got any idea what might be going on here I’d really appreciate it.

AMP’s SFTP implementation can be thought of as a “dumb”/“fake” SSH environment. All it allows are file operations, with no other command line actions available to the session.
You’d want to connect using Putty on port 22 using whichever information Hostinger has given you. Somewhere in their VPS management setup they should have a root password you can use (that wouldn’t be in the AMP panel, but on their actual website somewhere)

  1. Didn’t realize that was a “fake” SSH environment
  2. Didn’t realize that the root login was actually different than the login I had been using to access the panel.
    Pulled the info from my actual hostinger settings, used PuTTy to SSH in, used getamp installJava and java -version, and CHECK!
    openjdk version “21.0.5” 2024-10-15 LTS.

When I create a new instance, Java 21 is an option. It is not an option for the current instance, and I can’t figure out why, but I’m pretty sure I can just transfer the world save file. Thanks!

You can stop/start your old instances from the main panel to get the Java runtimes to refresh

1 Like

Oh sweet thanks, that worked