Remove Linux-brought JDK to install new JDK

Source: Internet
Author: User
Tags gz file

After installing the Linux system, the system has its own JDK version, because some of the software in the system needs to use this environment. But when we install Eclipse and Tomcat, it's not possible to use this JDK. At this point we need to install our own downloaded JDK, but before that we need to uninstall the JDK that comes with the system.

First look at the Java version of the system:java-version; then use:rpm-qa | grep java command to see the specific information, and finally use:rpm-e--nodeps java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64 Uninstall.

Find:

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/88/14/wKiom1fo9DryQkfcAAAQ2KsvvHE668.png-wh_500x0-wm_3 -wmp_4-s_386797127.png "title=" 1.png "alt=" Wkiom1fo9dryqkfcaaaq2ksvvhe668.png-wh_50 "/>

Unloading:

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/88/11/wKioL1fo9GmA9uu9AAAiNiBR2gQ611.png-wh_500x0-wm_3 -wmp_4-s_1182863763.png "style=" float:left; "title=" 2.png "alt=" Wkiol1fo9gma9uu9aaainibr2gq611.png-wh_50 "/>




Installation:

Step one: Download jdk-7u55-linux-i586.tar.gz, official: http://www.oracle.com/technetwork/java/javase/downloads/ JAVA-ARCHIVE-DOWNLOADS-JAVASE7-521261.HTML#JDK-7U55-OTH-JPR. After downloading the jdk-7u55-linux-i586.tar.gz file to the local, upload it to the Linux system for decompression and installation.

RZ command:


650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/88/14/wKiom1fo9KfCWR3rAAAS5rBwDGE185.png-wh_500x0-wm_3 -wmp_4-s_638618482.png "title=" 3.png "alt=" Wkiom1fo9kfcwr3raaas5rbwdge185.png-wh_50 "/>

Unzip the installation:

#创建文件夹

Mkdir/usr/java

#解压

TAR-ZXVF jdk-7u55-linux-i586.tar.gz-c/usr/java/

Set the environment variable and add the following to the environment variable file:

Vim/etc/profile

#在文件最后添加

Exportjava_home=/usr/java/jdk1.7.0_55

Exportpath= $PATH: $JAVA _home/bin

#刷新配置

Source/etc/profile

Error occurred:


650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/88/14/wKiom1fo9NLgXoPQAAAZMx0xSpw832.png-wh_500x0-wm_3 -wmp_4-s_2790445068.png "title=" 4.png "alt=" Wkiom1fo9nlgxopqaaazmx0xspw832.png-wh_50 "/>

Workaround:

Online search, with the sudo yum install glibc.i686 command installed glibc after the problem solved.


This article is from the "12103298" blog, please be sure to keep this source http://dongkevin.blog.51cto.com/12103298/1856731

Remove Linux-brought JDK to install new JDK

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.