1. Linux download and install jdk11
1. Download and unzip the installation
-
Go to oracle official website to download jdk. Passed to the Linux server through ftp.
https://www.oracle.com/technetwork/java/javase/downloads/index.html
-
Create address directory / usr / local / jdk
-
Unzip
tar -xvf /other/jdk/文件名 -C 、usr/local/jdk
2. Configure the environment
- Configuration
vi /etc/profile
Add the following in the last line:
JAVA_HOME=/usr/local/jdk/jdk-11.0.5
JRE_HOME=$JAVA_HOME/
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
Note:
There is no jre folder in the unzipped directory. When you start Tomcat, you will find the jre directory.
- Make the configuration effective
source /etc/profile
- Check if the configuration is successful
java -version
2.linux download and install tomcat
-
Download
http://mirrors.hust.edu.cn/apache/tomcat/tomcat-9/v9.0.29/bin/ and
upload it to the / other / tomcat file of Linux through ftp. -
Unzip
tar -xvf /other/tomcat/文件名 [-C 目标地址]
- Open port 8080
firewall-cmd --zone=public --add-port=8080/tcp --permanent 永久开启8080端口
firewall-cmd --reload 重新载入
-
Start, stop tomcat
into the bin directory, ./starup.sh to open tomcat, ./shutdown.sh to close tomcat
-
Set boot from boot