in the configuration Hadoop is, in the format of Hadoop, there is no JDK found I used CENTOS7 is 64 bit, found that the machine has Java, looked for its location found the JDK-1.7.0_75which java[[email protected] Hadoop-1.1.2]# which Java/usr/bin/Java[[email protected] Hadoop-1.1.2]# ls/usr/bin/Java/usr/bin/Java[[email protected] Hadoop-1.1.2]# ls-l/usr/bin/javalrwxrwxrwx.1Root root AJune - Geneva:xx/usr/bin/java-/etc/alternatives/Java[[email protected] Hadoop-1.1.2]# ls-l/etc/alternatives/javalrwxrwxrwx.1Root root theJune - Geneva:xx/etc/alternatives/java-/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java(you can see that the file is link, is a link) [[email protected] Hadoop-1.1.2]# ls-l/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java-rwxr-xr-x.1Root root36548Oct - ./usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java[[email protected] Hadoop-1.1.2]# cd/usr/lib/jvm/jre-1.7.0-openjdk.x86_64[email protected] jre-1.7.0-openjdk.x86_64]# Lsbin Lib So, can be temporarily determined to be/usr/lib/jvm/jre-1.7.0-openjdk.x86_64The root user changes the configuration file: VI/etc/Profile Find export PATH USER LOGNAME MAIL HOSTNAME histsize Histcontrol write down below: Export Java_home=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64Export PATH= $PATH: $JAVA _home/Binexport CLASSPATH=.: $JAVA _home/lib/tools.jar: $JAVA _home/lib/Dt.jar:wq Save exit with Echo $JAVA _home#更新jdkupdate-alternatives--install/usr/bin/java Java/opt/jdk1.7.0_79/bin/java -Update-alternatives--install/usr/bin/javac Javac/opt/jdk1.7.0_79/bin/javac -Update-alternatives--install/usr/bin/jar Jar/opt/jdk1.7.0_79/bin/jar -Update-alternatives--config Java selection with JDK1.7the. 0_79 option is available.
View your own JDK in Linux, set Java_home