All the versions of JDK come bundled up with the JRE (Java Runtime Environment). This way, a user doesn’t have to download and install JRE on their PC separately.
https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-4.html
check the major version for your JAVA code (the java class file)
65 is the major version , correspond to JAVA-21
you HAVE TO READ RUNNING.TXT , located in tomcat/
JRE_HOME or JAVA_HOME , required , not both , so simple solution , just delete JRE_HOME , altough some servlet tutorials (almost all) lead you to set up both .
if you find is neccesary set up both of them , this is the proccess , at final i give you some advices if nothing of these works ….
check our environments variables , this is the reason of our problem
we can comprobe just looking in our apachetomcat initialization
to solve you should JAVA_HOME == JRE_HOME , i mean have to be the same both jdk-21
JRE_HOME= xxx.yyyy.zzzz/jdk-21
check the current Java version load by server in in manager/html
admi user admin password is not the default one , have to config in tomcat-users.xml
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
now , launch again tomcat server
install apache tomcat as a SERVICE is not the same that execute by startup.bat , just for test purpose you unistall the service one , and download a zip one , then launch it using startup.bat located at bin folder , indeed you can use both , just need to change the ports , but i suggest you foor test purpose unistall one of them