51

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;

2

2 Answers 2

73

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
6
  • 3
    I suppose you meant to put the "...\bin" folders inside the PATH, not inside the CLASSPATH Aug 1, 2016 at 12:54
  • All I meant to say was to declare the path in system variables and by default the variable name globally is Path. Aug 1, 2016 at 17:04
  • 1
    this solution works with me for apache tomcat 9 Oct 2, 2017 at 15:32
  • 1
    Worked for me for Tomcat 9
    – Nibras
    Mar 29, 2018 at 4:16
  • 1
    This 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 Dec 16, 2018 at 12:57
44

Your JRE_HOME does not need to point to the "bin" directory. Just set it to C:\Program Files\Java\jre1.8.0_25

3
  • 4
    I tried but its not working.Still the same error persist. Mar 11, 2015 at 16:15
  • Perfect answer...
    – Sagar
    Dec 9, 2016 at 12:43
  • 3
    In 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. Dec 20, 2017 at 9:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.