Install Javajdk1.7.0 _ 10 in CentOS6

Source: Internet
Author: User
Tags gz file
Installation steps are as follows: 1.download jdk7.0_10(jdk-7u10-linux-i586.tar.gz) Address: 2. uninstall the built-in open source JDK to check whether JDKrpm-qa | grepjava shows the following information: java-1.4.2-gcj-compa

The installation procedure is as follows:

1. download JDK7.0 _ 10 (jdk-7u10-linux-i586.tar.gz)

Address:

2. uninstall the built-in open source JDK

Check whether JDK is installed

rpm -qa | grep java

The following information is displayed:

Java-1.4.2-gcj-compat-1.4.2.0-40jpp.115

Java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5

Yes, execute the following code to delete it:

rpm –e java
3.beibeijdk-7u10-linux-i586.tar.gz to the installation directory
[root@web-1 soft]# mv java/jdk-7u10-linux-i586.tar.gz /home/software/
4.decompress the jdk-7u10-linux-i586.tar.gz file. after decompression, a new directory named jdk1.7.0 _ 10 will be generated under the/usr/java directory.
[root@web-1 software]# tar zxvf jdk-7u10-linux-i586.tar.gz
Now, the installation is complete. The following describes how to set environment variables.
[root@web-1 software]# vi /etc/profile
Shift + g to the end of the file and add the code:
export JAVA_HOME=/home/software/jdk1.7.0_10export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATHexport CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

Make the environment variable take effect, and execute the configuration file to make it take effect immediately

[root@web-1 software]# source /etc/profile
Run the following command to verify whether the installation is successful:
[root@web-1 software]# java -version
If the following information appears, the installation is successful:
java version "1.7.0_10"Java(TM) SE Runtime Environment (build 1.7.0_10-b18)Java HotSpot(TM) Client VM (build 23.6-b04, mixed mode)
If the following error occurs:
-bash: /home/software/jdk1.7.0_10/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
Solution:
[root@web-1 software]# yum install -y mesa-libGL.i686

So far, jdk has been installed.

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.