View your own JDK in Linux, set Java_home

Source: Internet
Author: User

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

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.