CentOS6.4 uninstall your own openjdk and install jdk1.6.21

Source: Internet
Author: User

#进入系统的terminal to view the current JDK version:

Shell>java-version

#查看安装包

Shell>rpm-qa|grep Java

#将上条命令查出来的结果卸载掉 and see if the uninstallation was successful

Shell>rpm-e--nodeps ... java ...

Sehll>java-version

#下载jdk安装包, Address: http://www.oracle.com/technetwork/java/javase/downloads/ Java-archive-downloads-javase6-419409.html#jdk-6u21-b07-oth-jpr

#将下载的文件jdk -6u21-linux-x64-rpm.bin into the/usr/java directory

Shell>mkdir/usr/java

Shell>cd/usr/java

#查看jdk Permissions for -6u21-linux-x64-rpm.bin

Shell>list-l

#修改为可执行

Shell>chmod 777 Jdk-6u21-linux-x64-rpm.bin

#执行安装包

Shell>./jdk-6u21-linux-x64-rpm.bin

#配置环境变量, edit the file/etc/profile, join in the last few lines

#export java_home=/usr/java/jdk1.6.0_21
#export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
#export path= $PATH: $JAVA _home/bin

Shell>vi/etc/profile

#使环境变量生效

Shell>source/etc/profile

#查看jdk版本

Shell>java-version

It's supposed to be a success here.

CentOS6.4 uninstall your own openjdk and install jdk1.6.21

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.