Centos SUN JDK Installation

Source: Internet
Author: User

1. Remove the extra JDK

Rpm-qa | grep ' JAVA|GCJ ' | Xargs-t-I {} rpm-e--nodeps {}

RPM-E--nodeps *

Rpm-qa|grep JDK

RPM-E--nodeps *

Rpm-qa |grep GCJ

Rpm-qa |grep *


2. Download jdk-*.tar.gz from Oracle website

3. Extract tar.gz files, then copy to/usr/lib/jvm/

4. Configure Update-alternatives

Update-alternatives--install/usr/bin/java Java/usr/lib/jvm/jdk1.7.0_80/bin/java 300

Update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/jdk1.7.0_80/bin/javac 300

5. Configure Environment variables

VI ~/.bash_profile

Export java_home=/usr/lib/jvm/jdk1.7.0_80
Export JRE_HOME=/USR/LIB/JVM/JDK1.7.0_80/JRE
Export classpath=.: $JAVA _home/bin/dt.jar: $JAVA _home/lib/tools.jar: $CLASSPATH
Export path= $JAVA _home/bin/: $PATH: $HOME/bin

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.