Tomcat service安装错误
命令行输入:
service install
报错:
The file Tomcat8.exe was not found...
Either the CATALINA_HOME environment variable is not defined correctly or
the incorrect service name has been used.
Both the CATALINA_HOME environment variable and the correct service name
are required to run this program.
原因:
缺少 CATALINA_HOME 环境变量,不能直接图省事在path里面加,会报错同样的错
C:\apache-tomcat-8.5.59\bin
解决方案:
1.新建环境变量CATALINA_HOME,变量值设为C:\apache-tomcat-8.5.59(自己Tomcat的安装目录)
2.再path变量里面添加:
%CATALINA_HOME%\bin
之后再命令行输入:service install
C:\Users\pc>service install
Installing the service 'Tomcat8' ...
Using CATALINA_HOME: "C:\apache-tomcat-8.5.59"
Using CATALINA_BASE: "C:\apache-tomcat-8.5.59"
Using JAVA_HOME: "C:\Program Files\Java\jdk1.8.0_131"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_131\jre"
Using JVM: "C:\Program Files\Java\jdk1.8.0_131\jre\bin\server\jvm.dll"
The service 'Tomcat8' has been installed.