Install the java environment
First of all, we first go to the java official website to download jdk. Here I download the jdk1.8 version
Click accept license agreement and select To download the version, you need to register an oracle account to log in to download!
Copy the downloaded jdk package to the centos7 root directory. It is recommended to use winscp software
Create the java installation directory
mkdir -p /usr/local/java
Extract the jdk package to the java installation directory
tar -zxvf jdk-8u211- linux-x64.tar.gz -c /usr/local/java/
Configure environment variables
vim /etc/profile.d/java. sh
export java_home=/usr/local/java/jdk1.8.0_211 export class_path="$java_home/lib:$java_home/jre/lib" export path=$path:$java_home/bin
Make the configuration take effect immediately
source /etc/profile
Verify whether the java environment is successfully configured
Install tomcat environment
Download the installation package from the official website:
Here I choose tomcat8 archives to view the history Version
#Here I choose version v8.5.5. Remember not to enter src to download the installation package. You will encounter the problem that bootstarp.jar cannot be found in the bin directory. Question, enter the bin directory and download the code package.
Extract to the installation directory
tar -zxvf apache-tomcat-8.5.5.tar.gz - c /usr/local/
Create soft link
cd /usr/local/ ln -sv apache-tomcat-8.5.5 tomcat
Configure environment variables
##vim /etc/profile.d /tomcat.sh
catalina_base=/usr/local/tomcat path=$catalina_base/bin:$path export path catalina_base
source /etc/profile.d/tomcat.sh
cd /usr/local/tomcat/bin/
chmod 755 *
./catalina.sh version
./startup.sh
The above is the detailed content of How to deploy and install Java+Tomcat environment. For more information, please follow other related articles on the PHP Chinese website!