Tomcat is not running even though JAVA_HOME path is correct

前端 未结 18 2141
情深已故
情深已故 2020-12-09 16:07

When I am trying to run tomcat using startup.bat I get the following error,

The JAVA_HOME environment variable is not defined correctly
This env         


        
相关标签:
18条回答
  • 2020-12-09 17:03
    First Run the tomcat directly through the tomcat /bin folder with 
    startup.bat if running sucessful the set the variable as below sample    
    

    JAVA_HOME value : C:\Program Files\Java\jdk1.6.0_32;

    path: C:\Program Files\Java\jdk1.6.0_32\bin;

    CATALINA_HOME=C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27 ;

    PATH=%PATH%;%JAVA_HOME%\bin;%CATALINA_HOME%\bin;

    if needed CLASS_PATH:%CATALINA_HOME%\lib;%JAVA_HOME%\lib;

    0 讨论(0)
  • 2020-12-09 17:06

    I deleted the Tomcat and unzipped it again and it worked.

    0 讨论(0)
  • 2020-12-09 17:06

    Check the comparability, if you are using java 8 then use tomcat 9, if you are using java 7 then use tomcat 7. and also set the JAVA_HOME till C:\Program Files\Java\jdk1.8.0_101, not with bin.

    0 讨论(0)
  • 2020-12-09 17:06

    Remove semicolon and you can see that link: http://www.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html

    0 讨论(0)
  • 2020-12-09 17:07

    To run Tomcat8 you need to have JRE_HOME defined in Env Variable.

    JAVA_HOME alone will not do even if correctly set.

    JRE_HOME = C:\Program Files\Java\jdk1.8.0_77\jre
    

    You should select the JRE that is inside SDK, i.e. one with your JDK(SDK) installation. In other words your JAVA_HOME + \jre

    When compiling JDK is needed to support JSP, to compile Servlets which are generated from *.jsp files. Otherwise to run JRE is needed. So when you develop you need JAVA_HOME and when you deploy you need JRE_HOME.

    0 讨论(0)
  • 2020-12-09 17:08

    Also ensure that you have the correct version of Tomcat for the CPU type. I had installed a 64bit tomcat on a 32bit O/S but it was giving me the JAVA_HOME exception when that wasn't the case at all.

    0 讨论(0)
提交回复
热议问题