Home >Java >javaTutorial >How to deploy and install Java+Tomcat environment

How to deploy and install Java+Tomcat environment

王林
王林forward
2023-04-30 19:40:051371browse

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!

How to deploy and install Java+Tomcat environment

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


How to deploy and install Java+Tomcat environment

Install tomcat environment

Download the installation package from the official website:

Here I choose tomcat8 archives to view the history Version


How to deploy and install Java+Tomcat environment

#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.


How to deploy and install Java+Tomcat environment

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

Let the configuration take effect


source /etc/profile.d/tomcat.sh

View tomcat version status

Enter tomcat’s bin directory


cd /usr/local/tomcat/bin/

Give permissions


chmod 755 *

View configuration information


./catalina.sh version


How to deploy and install Java+Tomcat environment

Start tomcat service


./startup.sh


How to deploy and install Java+Tomcat environment

If the above content appears, it means success. Now visit ip:8080 to see


How to deploy and install Java+Tomcat environment

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete