Install JDK and tomcat on Linux (vegetable chicken level)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.