当前位置:   article > 正文

java home is not set_Error: JAVA_HOME is not set and could not be found.

java home is not set_Error: JAVA_HOME is not set and could not be found.

Error: JAVA_HOME is not set and could not be found.

问题:

Centos7 安装CDH时报错:Error: JAVA_HOME is not set and could not be found.

+ local name=log4j.properties

+ '[' '!' -f /opt/cloudera-manager/cm-5.14.1/run/cloudera-scm-agent/process/ccdeploy_spark-conf_etcsparkconf.cloudera.spark_on_yarn_6447222260596468198/spark-conf/yarn-conf/log4j.properties ']'

+ mv /opt/cloudera-manager/cm-5.14.1/run/cloudera-scm-agent/process/ccdeploy_spark-conf_etcsparkconf.cloudera.spark_on_yarn_6447222260596468198/hbase-conf/log4j.properties /opt/cloudera-manager/cm-5.14.1/run/cloudera-scm-agent/process/ccdeploy_spark-conf_etcsparkconf.cloudera.spark_on_yarn_6447222260596468198/spark-conf/yarn-conf

+ for i in '"$HBASE_CONF_DIR"/*'

++ basename /opt/cloudera-manager/cm-5.14.1/run/cloudera-scm-agent/process/ccdeploy_spark-conf_etcsparkconf.cloudera.spark_on_yarn_6447222260596468198/hbase-conf/ssl-client.xml

+ local name=ssl-client.xml

+ '[' '!' -f /opt/cloudera-manager/cm-5.14.1/run/cloudera-scm-agent/process/ccdeploy_spark-conf_etcsparkconf.cloudera.spark_on_yarn_6447222260596468198/spark-conf/yarn-conf/ssl-client.xml ']'

++ get_default_fs /opt/cloudera-manager/cm-5.14.1/run/cloudera-scm-agent/process/ccdeploy_spark-conf_etcsparkconf.cloudera.spark_on_yarn_6447222260596468198/spark-conf/yarn-conf

++ get_hadoop_conf /opt/cloudera-manager/cm-5.14.1/run/cloudera-scm-agent/process/ccdeploy_spark-conf_etcsparkconf.cloudera.spark_on_yarn_6447222260596468198/spark-conf/yarn-conf fs.defaultFS

++ local conf=/opt/cloudera-manager/cm-5.14.1/run/cloudera-scm-agent/process/ccdeploy_spark-conf_etcsparkconf.cloudera.spark_on_yarn_6447222260596468198/spark-conf/yarn-conf

++ local key=fs.defaultFS

++ '[' 1 == 1 ']'

++ /opt/cloudera/parcels/CDH-5.14.4-1.cdh5.14.4.p0.3/lib/hadoop/../../bin/hdfs --config /opt/cloudera-manager/cm-5.14.1/run/cloudera-scm-agent/process/ccdeploy_spark-conf_etcsparkconf.cloudera.spark_on_yarn_6447222260596468198/spark-conf/yarn-conf getconf -confKey fs.defaultFS

Error: JAVA_HOME is not set and could not be found.

+ DEFAULT_FS=

解决方法

使用rpm 安装jdk

下载jdk-8u201-linux-x64.rpm

chmod 755 jdk-8u201-linux-x64.rpm

rpm -i jdk-8u201-linux-x64.rpm

配置环境变量:

export JAVA_HOME=/usr/java/jdk1.8.0_201-amd64

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/jre/lib/rt.jar

export PATH=$PATH:$JAVA_HOME/bin

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/574539
推荐阅读
相关标签
  

闽ICP备14008679号