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://awodore.vivaldi.net/wp-content/uploads/sites/30164/2024/07/imagen-7.png)
https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-4.html
check the major version for your JAVA code (the java class file)
![](https://awodore.vivaldi.net/wp-content/uploads/sites/30164/2024/07/imagen-8.png)
65 is the major version , correspond to JAVA-21
you HAVE TO READ RUNNING.TXT , located in tomcat/
![](https://awodore.vivaldi.net/wp-content/uploads/sites/30164/2024/07/imagen-9-1024x457.png)
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
![](https://awodore.vivaldi.net/wp-content/uploads/sites/30164/2024/07/imagen-4.png)
we can comprobe just looking in our apachetomcat initialization
![](https://awodore.vivaldi.net/wp-content/uploads/sites/30164/2024/07/imagen-1-1024x147.png)
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
![](https://awodore.vivaldi.net/wp-content/uploads/sites/30164/2024/07/imagen-2.png)
admi user admin password is not the default one , have to config in tomcat-users.xml
![](https://awodore.vivaldi.net/wp-content/uploads/sites/30164/2024/07/imagen-3-1024x302.png)
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
now , launch again tomcat server
![](https://awodore.vivaldi.net/wp-content/uploads/sites/30164/2024/07/imagen-5-1024x106.png)
![](https://awodore.vivaldi.net/wp-content/uploads/sites/30164/2024/07/imagen-6.png)
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