安装tomcat的时候,运行tomcat控制台,service status为stopped,通过运行C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\startup.bat,发现报错如下:

the catalina_home environment variable is not defined correctly
this environment variable is needed to run this program

解决方案:
运行startup.bat

C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin>startup.bat
Using CATALINA_BASE:   "C:\Program Files\Apache Software Foundation\Tomcat 8.5"
Using CATALINA_HOME:   "C:\Program Files\Apache Software Foundation\Tomcat 8.5"
Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 8.5\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk-12.0.1"
Using CLASSPATH:       "C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\tomcat-juli.jar"

设置CATALINA_HOME环境变量为C:\Program Files\Apache Software Foundation\Tomcat 8.5,运行startup.bat可以成功,但是运行tomcat控制台service status依旧为stopped。切换到startup选项卡,MODE模式从JVM修改为JAVA,start成功。

发表评论

邮箱地址不会被公开。 必填项已用*标注