Installing JDK7 under CentOS

Source: Internet
Author: User


Appears: configure:error:the java_home environment variable must be set to your JDK location.

Workaround:

1. First uninstall the JDK from CentOS, then install the Sun JDK

Reference: http://hermosa-young.iteye.com/blog/1798026

Http://www.cnblogs.com/hitwtx/archive/2012/02/13/2349752.html

Rpm-qa | grep java//view JDK information

Yum-y Remove Java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5//Uninstall

Download Sun's JDK http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html Download jdk-7u71-linux-i586.rpm

Create a Java directory under/usr in case the Java program is installed in this directory

Mkdir/usr/java

Cd/usr/java

RPM-IVH jdk-7u71-linux-i586.rpm Decompression, in the/usr/java directory will generate a new directory jdk1.7.0_71, the directory is stored in the extracted files.

For ease of Setup later, we created the directory jdk1.7.0_71 renamed JDK MV Jdk1.7.0_71 JDK

Finally, set the environment variable

Vi/etc/profile

Export JAVA_HOME=/USR/JAVA/JDK

Export path= $PATH: $JAVA _home/bin

Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Execute the configuration file to make it effective immediately source/etc/profile

Verify that the installation is successful

Java-version The following three lines appear to indicate success

Java Version "1.7.0_71"

Java (TM) SE Runtime Environment (build 1.7.0_71-b14)

Java HotSpot (TM) Client VMs (build 24.71-b01, Mixe dmode, sharing)









This article is from the "See" blog, please be sure to keep this source http://732233048.blog.51cto.com/9323668/1630283

Installing JDK7 under CentOS

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.