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