Startup Issue with Minecraft - minecraft server unable to run

System Information

Field Value
Operating System Windows - Windows 11 Pro on x86_64
Product AMP ‘Phobos’ v2.6.3.2 (Mainline)
Virtualization None
Application Minecraft
Module MinecraftModule
Running in Container No
Current State Failed

Problem Description

Issue

when I try to start a server,it gives my an error like can’t start server,this is not AMP fault please check logs,and in console it shows “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 65.0), this version of the Java Runtime only recognizes class file versions up to 52.0”

Reproduction Steps

  • make minecraft server
  • start server
  • server stops at its own after starting

You need to select Java 21 under Java and Memory.
If the option isn’t available you’ll need to install Java 21.