Centos7yum install JDK and Tomcat detailed tutorial

One, install JDK

(1) Download: jdk-7u55-linux-i586.tar.gz to the linux/usr/local/tools directory

jdk download address: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jdk-7u55-oth-JPR .

The tools directory can be created by yourself

(2) Unzip: tar zxvf jdk-7u55-linux-i586.tar.gz

Insert picture description here

(Three), execute vi profile, configure environment variables at the end

export JAVA_HOME=/usr/local/softwire-package/jdk1.7.0_55
export JRE_HOME=${
    
    JAVA_HOME}/jre
export CLASSPATH=.:${
    
    JAVA_HOME}/lib:${
    
    JRE_HOME}/lib
export PATH=${
    
    JAVA_HOME}/bin:${
    
    PATH}

1. Press ESC: wq to enter
[Note] Change the red part to your own path.
Insert picture description here
2. Restart reboot
3. Enter java, javac to verify

Problem 1:
Insert picture description here
Reason: The /lib/ld-linux.so.2 directory does not exist.
Solution: Run the command: yum install glibc.i686

One, install Tomcat

(1) Download: apache-tomcat-7.0.42.tar.gz to the linux/usr/local/tools directory

(2) Unzip: tar zxvf apache-tomcat-7.0.42.tar.gz

(3) Start Tomcat

In the bin directory, enter the command ./startup.sh to start Tomcat
Insert picture description here

(4) Firewall settings

1. Check the firewall status: systemctl status firewalld
2. Temporarily close the firewall command; after restarting the computer, the firewall will automatically start: systemctl stop firewalld
3. Permanently close the firewall command. After restarting, the firewall will not start automatically: systemctl disable firewalld
4. Open the firewall command: systemctl enable firewalld

我们本次需要使用临时关闭防火墙命令,将防火墙关闭

(5) Browser access

Insert picture description here

Welcome like-minded comrades to add VX: zl13453013578, let's discuss and study together and make progress together.

Guess you like

Origin blog.csdn.net/javaScript1997/article/details/108018550