• 查看并配置JAVA_HOME


    转载自https://blog.csdn.net/weixin_41713592/article/details/79941418

    which java [root@host2 hadoop-1.1.2]# which java /usr/bin/java [root@host2 hadoop-1.1.2]# ls /usr/bin/java /usr/bin/java [root@host2 hadoop-1.1.2]# ls -l /usr/bin/java lrwxrwxrwx. 1 root root 22 Jun 20 03:00 /usr/bin/java -> /etc/alternatives/java [root@host2 hadoop-1.1.2]# ls -l /etc/alternatives/java lrwxrwxrwx. 1 root root 39 Jun 20 03:00 /etc/alternatives/java -> /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java (可以看出文件是link ,是个链接) [root@host2 hadoop-1.1.2]# ls -l /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
    -rwxr-xr-x. 1 root root 36548 Oct 25 2011 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java [root@host2 hadoop-1.1.2]# cd /usr/lib/jvm/jre-1.7.0-openjdk.x86_64 [root@host2 jre-1.7.0-openjdk.x86_64]# ls bin lib 如此来,可以暂时的断定是 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64 root用户下改配置文件 : vi /etc/profile 找到export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL 在下面写上: export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64 export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar :wq 保存退出 用echo $JAVA_HOME #更新jdk update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_79/bin/java 300 update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_79/bin/javac 300 update-alternatives --install /usr/bin/jar jar /opt/jdk1.7.0_79/bin/jar 300 update-alternatives --config java 选择带有jdk1.7.0_79 的选项
  • 相关阅读:
    调试常用命令
    android获取手机机型、厂商、deviceID基本信息
    融云即时通讯 添加地理位置信息的功能
    Linux centOS下搭建RTMP服务器的具体步骤
    数组与字符串 1.4
    数组与字符串 1.5
    数组与字符串 1.3
    数组与字符串 1.2
    数组与字符串 1.1
    笔记本自开wifi设置
  • 原文地址:https://www.cnblogs.com/weosuper/p/10592425.html
Copyright © 2020-2023  润新知