安装tomcat
1、下载tomcat
前往tomcat官网下载需要版本的tomcat(https://tomcat.apache.org/download-90.cgi)
2、创建tomcat安装目录
在/usr/local/目录下创建tomcat目录,将下载好的gz文件拷贝到该目录下
3、解压安装tomcat
利用tar命令解压安装tomcat
4、启动tomcat
调用./bin/startup.sh 来启动tomcat,查看启动是否成功。
问题:
1、启动出错,报 Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this program错误提示
答: 在/bin/setclasspath.sh文件中,为tomcat指定java环境
export JAVA_HOME=/usr/local/java/jdk-9
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
Good code is short, simple, and symmetrical—the challenge is figuring out how to get there