Issue
I am trying to deploy the web application using tomcat 9.0. I am getting below error:
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
after executing .\catalina.bat
run command
Solution
Tomcat needs the JAVA_HOME and JRE_HOME environment variables. You need to setup your JAVA_HOME and JRE_HOME environment variables as shown step by step in the link below:
For Windows: https://www.mkyong.com/java/how-to-set-java_home-on-windows-10/
For Ubuntu: https://www.mkyong.com/java/how-to-install-java-jdk-on-ubuntu-linux/
I hope this solves your problem.
Answered By - Ali