Tomcat 安装与配置

一、Tomcat 安装

可以下载 zip 格式或 exe 格式的,其中 zip 格式的只要解压缩再配置下环境变量就可以使用了。

1、先下载 tomcat,到 http://tomcat.apache.org/ 官网下载免安装版!

2、下载完后,解压到你的磁盘任意位置下即可!( 建议纯英文路径 )

3、Tomcat 的目录结构详细介绍:

Tomcat| Tomcat的目录结构详细介绍(超全)_YvesHe的博客-CSDN博客

二、Tomcat 配置

解压后,给 Tomcat 配置环境!

1、如果要想在任意目录下都能启动Tomcat,

就需要设置 CATALINA_HOME 环境变量(Tomcat的安装目录), 注意在 Path下也要设置%CATALINA_HOME%\bin

2、在 setclasspath.bat 文件里声明环境变量,添加上自己本地的 jdk、jre路径。

set JAVA_HOME=D:\Java\jdk1.8.0_221
set JRE_HOME=D:\Java\jdk1.8.0_221\jre

三、启动 Tomcat 服务器

1、win+R → cmd → 输入"startup"

2、地址栏输入 http://localhost:8080,出现下面页面即为成功!

若startup后,出现 Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environ 问题,参考下面解决方法:

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environ-阿里云开发者社区 (aliyun.com)

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environ_Resourceful!的博客-CSDN博客

posted @ 2022-08-15 00:05  鹿先森JIAN  阅读(314)  评论(0编辑  收藏  举报