CentOS removes its own openjdk and installs SUNJDK

Source: Internet
Author: User

[Email protected] local]# Java-Versionjava version"1.6.0"OpenJDK Runtime Environment (build1.6.0-b09) OpenJDK --bit Server VM (build1.6.0-b09, Mixed mode) [Email protected] local]# rpm-qa |grepJavajava-1.6.0-openjdk-1.6.0.0-1.7. B09.el5java-1.4.2-gcj-compat-1.4.2.0-40JPP. the[email protected] local]# rpm-E--nodeps java-1.6.0-openjdk-1.6.0.0-1.7. B09.el5[[email protected] local]# rpm-E--nodeps java-1.4.2-gcj-compat-1.4.2.0-40JPP. the[[email protected] local]# java-version-bash:/usr/bin/java:no Suchfileor directory

Install SUNJDK:

mkdir Java[[email protected] local]# CD Java/pwd/usr/local/wget http://  download.oracle.com/otn/java/jdk/6u45-b06/jdk-6u45-linux-i586.binchmod +x jdk-6u45-linux- I586.bin [[email protected] java]#. /jdk-6u45-linux-i586.bin

After unpacking the installation package, configure the environment variables:

VI /etc/profile

Add (Note the installation path) on the last line of the file:

Java_home=/usr/local/java/jdk1. 6 . 0_45jre_home=/usr/local/java/jdk1. 6. 0_45/Jrepath= $PATH: $JAVA _home/bin: $JRE _home/Binclasspath=.: $JAVA _home/lib/jt.jar: $JAVA _home/lib/tools.jar: $JRE _home/libexport java_home jre_home PATH CLASSPATH

After you save the exit, make it effective:

[Email protected]java]# source/etc/-"1.6.0_45"1.6 . 0_45-20.45-b01, Mixed mode)

CentOS removes its own openjdk and installs SUNJDK

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.