Installing the JDK
Uninstalling OPENJDK
Rpm-qa|grep JDK//view current JDK situation
Yum-y Remove Java java-1.7.0-openjdk*//uninstall OPENJDK
1. Create a Java folder under the USR folder
2. Download the copy JDK to the/usr/java folder and unzip
file [filename]//view files are normal
LS-LHT//view file details
RM-RF jdk-7u79-linux-x64.tar.gz//Remove JDK Compression pack
3. Configure Environment variables
Vi/etc/profile Open File Configuration environment variables
Press I to enter edit mode and enter the following at the end of the file:
Export java_home=/usr/java/jdk-1.7.0_79
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Press ESC to exit edit mode after editing is complete, enter: Wq Save and exit
Test java-version
Installing Tomcat
CD/USR//Enter USR folder
mkdir Tomcat//Create Tomcat folder
Download apache-tomcat-7.0.79.tar.gz to the Tomcat folder
TAR-ZXVF apache-tomcat-7.0.79.tar.gz//Unzip Tomcat
RM-RF apache-tomcat-7.0.79.tar.gz//Remove Tomcat compression pack
This is the time to successfully publish the project and to access the
But because there is no open port, it can only be limited to native access
Open ports
Open/etc/sysconfig/iptables with VI
I enter edit mode
Add-A input-m State--state new-m tcp-p TCP--dport 8080-j ACCEPT
ESC exits edit mode
: Wq Save and exit
Service iptables restart//restart Iptables services
Install JDK and tomcat on Linux (vegetable chicken level)