把tomcat安装成Windows的服务

        这是我于2019年在****上到处转悠的时候看到的一位大神写的,当前觉得很有意思,想着以后说不定哪天就会用到,于时就照着做了一遍,还真行了。以下是我的操作过程。

我的Tomcat安装在D:\apache-tomcat-8.5.28

1:进入CMD命令窗口

2:进入tomcat的bin目录:D:\apache-tomcat-8.5.28\bin

把tomcat安装成Windows的服务

3:安装:输入 service install 服务名(可为空)

把tomcat安装成Windows的服务

此时系统会有提示,选择“是”或者yes。此时需要花一点时间,耐心等,别以为挂了

 

4:安装好以后,需要重启系统,在服务管理里可以看到刚才安装的 Apache-tomcat tomcat8服务。

把tomcat安装成Windows的服务

启动这个服务,tomcat8就启动好了。在浏览器中输入http://localhost:8080/进行验证

5:删除服务:service remove tomcat