CentOS6.5 install SUNJDK1.7 and Tomcat 7

Source: Internet
Author: User
Tags gz file
I. preface the CentOS6.5 system comes with OpenJDK1.7, 1.6, and 1.5, but some OpenJDK content is not compatible with SUNJDK. Therefore, we plan to reinstall SUNJDK1.7 for development. 2. uninstall OpenJDK1. run the rpm command to view OpenJDK

I. Preface

CentOS6.5 comes with Open JDK 1.7, 1.6, and 1.5. However, some content of OpenJDK is not compatible with sun jdk. Therefore, we plan to reinstall sun jdk 1.7 for development.

II. uninstall Open JDK

1. run the rpm command to view the specific version of Open JDK.

# rpm -qa | grep java

The result may be

Tzdata-java-2012c-1.el6.noarchjava-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64

2. uninstall JDK through rpm

# rpm -e --nodeps tzdata-java-2012c-1.el6.noarch# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64

The Open JDK has been uninstalled.

 

3. install SUN JDK1.7

1. download the tag.gz File (http://www.oracle.com/technetwork/java/javase/downloads/index.html)

2. copy to/opt directory and decompress

/* Copy */# cp jdk-7u67-linux-x64.tar.gz/opt // * unzip */# tar-zxvf jdk-7u67-linux-x64.tar.gz

3. configure global environment variables

Append the following content to the/etc/profile file:

# jdk7 settingsJAVA_HOME=/opt/jdk1.7.0_67JRE_HOME=$JAVA_HOME/jrePATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/binCLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/libexport JAVA_HOME JRE_HOME PATH CLASSPATH

Run source/etc/profile to make the configuration take effect.

4. create a java soft link under the/sbin Directory

At this time, we enter the java command in shell, and the prompt/usr/bin cannot find the java command, that's because we haven't created a soft link for $ JAVA_HOME/bin/java in the/sbin directory.

ln -s /opt/jdk1.7.0_67/bin/java /sbin/java

The installation of SUN JDK1.7 has been completed!

4. install Tomcat 7

Tomcat has supported the Web Socket function since 7, so it is decided to use it!

1. download and decompress the package to the/opt directory.

2. add the following content at the top of the catalina. sh file:

export TOMCAT_HOME=/opt/apache-tomcat-7.0.55export CATALINA_HOME=/opt/apache-tomcat-7.0.55export JRE_HOME=/opt/jdk1.7.0_67/jreexport JAVA_HOME=/opt/jdk1.7.0_67

Run source catalina. sh to make the configuration take effect.

Related Article

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.