windows下tomcat的开机自启的设置
在tomcat的bin目录下建立startTomcat.bat文件内容如下所示:
@echo off
echo
call "%~dp0%service.bat" install tomcat8
echo
sc config tomcat8 start= auto
sc start tomcat8
exit
service.bat install tomcat8为建立tomcat服务
sc config tomcat8 start= auto为设定开机自启
sc start tomcat8 为启动服务
sc stop tomcat8 为停止服务
sc delete tomcat8为删除服务
如果你没有配置jdk路径的话,那么在service.bat开始时配上对应的Jdk指向即可,如下图所示