Getting Error:JRE_HOME variable is not defined correctly when trying to run startup.bat of Apache-Tomcat
155,755
Solution 1
Got the solution and it's working fine. Set the environment variables as:
CATALINA_HOME=C:\Program Files\Java\apache-tomcat-7.0.59\apache-tomcat-7.0.59
(path where your Apache Tomcat is)JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25;
(path where your JDK is)JRE_Home=C:\Program Files\Java\jre1.8.0_25;
(path where your JRE is)CLASSPATH=%JAVA_HOME%\bin;%JRE_HOME%\bin;%CATALINA_HOME%\lib
Solution 2
Your JRE_HOME does not need to point to the "bin" directory. Just set it to C:\Program Files\Java\jre1.8.0_25
Related videos on Youtube
Author by
Rajeev Dixit
I am a technology enthusiast, truly believes in doing, contributing, sharing to disrupt the ways for a better solution of every problem.
Updated on July 09, 2022Comments
-
Rajeev Dixit almost 2 years
When trying to start Tomcat Server through cmd prompt using 'startup.bat' getting error as-"JRE_HOME variable is not defined correctly. The environment variable is needed to Run this program" Defined Environment path as-
CATALINA_HOME-C:\Program Files\Java\apache-tomcat-7.0.59\apache-tomcat-7.0.59
JAVA_HOME-C:\Program Files\Java\jdk1.8.0_25;
JRE_Home-C:\Program Files\Java\jre1.8.0_25\bin;-
Faiz Ahmed over 5 yearsI solved my problem by the following link. stackoverflow.com/questions/44322378/…
-
user3806999 over 3 yearsThis happens when you have different versions of JDK and JRE versions.Please consider that too when u finding solution for this problem.Thanks
-
-
Rajeev Dixit about 9 yearsI tried but its not working.Still the same error persist.
-
Sorin Postelnicu almost 8 yearsI suppose you meant to put the "...\bin" folders inside the PATH, not inside the CLASSPATH
-
Rajeev Dixit almost 8 yearsAll I meant to say was to declare the path in system variables and by default the variable name globally is Path.
-
Sagar over 7 yearsPerfect answer...
-
Amir Choubani over 6 yearsthis solution works with me for apache tomcat 9
-
Bharti Rawat over 6 yearsIn my case same problem in occurring.. I just simply removed semicolon from JRE_HOME and put like this C:\Program Files\Java\jre1.8.0_25 then this problem resolved successfully.
-
Nibras about 6 yearsWorked for me for Tomcat 9
-
Sanket Gupte over 5 yearsThis solution is not working for me while trying with Tomcat 7. Have set the paths alright, yet getting the error as JRE_HOME environment variable not defined correctly. Have tried removing semicolon as well. Not working
-
Omak Al-Qantara about 3 yearsTomcat looks for JRE_HOME first and if it is not found then looks for JAVA_HOME so you don´t need both, also you don´t need the CLASSPATH variable, just include JAVA_HOME at path variable (%JAVA_HOME%\bin;) and that´s it, important: open a new console to start your tomcat this refreshes the changes.