Windows如何部署Tomcat

Windows如何部署Tomcat

一.下载Tomcat
下载地址:https://tomcat.apache.org/download-90.cgi
我下载的是32-bit/64-bit Windows Service Installer ,下载好之后安装,如下图,一直默认即可。
Windows如何部署Tomcat

二.配置环境变量
在桌面右键我的电脑 -> 属性 -> 高级系统设置 -> 高级 -> 环境变量 -> 系统变量。

在系统变量中新建CATALINA_HOME环境变量,
变量值为tomcat的安装路径 E:\apache-tomcat-9.0.16
Windows如何部署Tomcat
三.检测
打开bin目录下的startup命令,之后再浏览器输入http://localhost:8080/
如果出现一只猫的话,则代表部署成功
Windows如何部署Tomcat
四.部署到Eclipse
打开Eclipse->选择上方Windows->Preferences,选择server选项
这时我发现我的eclipse没有service,因为我的eclipse版本为se版本的。

1.查看自己的eclipse版本,我是2019-03
点击eclipse上方的Help->About Eclipse IDE
Windows如何部署Tomcat
2.点击help->Install New Software
Name:输入版本号2019-03
Location:http://download.eclipse.org/releases/2019-03
Windows如何部署Tomcat
勾选“Web,XML, Java EE and OSGi Enterprise Development”选项下“JST Server AdaptersExtensions”,点击next进行安装
Windows如何部署Tomcat
3.安装service之后点击Windows->Preferences,选择server选项,如下Windows如何部署Tomcat
4. 点击add
Windows如何部署Tomcat
5.路径选择Tomcat的安装路径
Windows如何部署Tomcat
6。Finish后完成安装,之后web项目即可部署Tomcat了。