Windows下安装好了tomcat了以后,可以直接进如 bin
目录双击 startup.bat
来启动,但是这样启动有一个文集就是任务栏会一直存在一个小窗口,这个窗口是tomcat的控制台,会随着后台程序的运行输出tomcat的运行情况,便于查找一些错误发生的原因。但是如果不小心关掉了该窗口,tomcat服务就停止运行了,很尴尬。那么如何才能后台启动tomcat呢?其实很简单,步骤如下:
1、管理员身份运行cmd

运行cmd.PNG
2、目录切换到tomcat安装目录的bin目录下,执行 service.bat install
。此时注意一个问题,下载的一定是 32-bit/64-bit Windows Service Installer
版本,其他版本没有 service.bat
文件。

添加服务.PNG
3、运行services.msc

运行services.msc.PNG