Home > Java > javaTutorial > body text

How to deploy and install Java+Tomcat environment

王林
Release: 2023-04-30 19:40:05
forward
1299 people have browsed it

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
Copy after login

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
Copy after login

Configure environment variables

##vim /etc/profile.d /tomcat.sh

catalina_base=/usr/local/tomcat
path=$catalina_base/bin:$path
export path catalina_base
Copy after login
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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!