Error: JAVA_HOME is not set and could not be found.
Problem:
Centos7 Install CDH Error: 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=
Solution:
Use rpm Install jdk
Download jdk-8u201-linux-x64.rpm
chmod 755 jdk-8u201-linux-x64.rpm
rpm -i jdk-8u201-linux-x64.rpm
configure environment variables:
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
Similar Posts:
- Install CDH6.2 agent error [How to Solve]
- failure: repodata/filelists.sqlite.bz2 from teamviewer: [Errno 256] No more mirrors to try
- [Solved] spark-shell Error: java.lang.IllegalArgumentException: java.net.UnknownHostException: namenode
- How to Solve Error: Heartbeating to master:7182 failed.
- Spark2.x Error: Queue’s AM resource limit exceeded.
- java.lang.RuntimeException: java.io.IOException: Initialize ConfOptimizer class occur error, javax.naming.AuthenticationException: Cannot get job queue name
- SparkSQL Use DataSet to Operate createOrReplaceGlobalTempView Error
- [Solved] /bin/bash: /us/rbin/jdk1.8.0/bin/java: No such file or directory
- [Solved] CDP7.1.7 Install hive on tez Error: Can’t create directory /mnt/ssd/yarn/nm/usercache/urika/appcache/application_1424508393097_0004 – Permission denied
- [Solved] Exception in thread “main” java.lang.NoSuchMethodError: org.apache.hadoop.security.HadoopKerberosName.setRuleMechanism(Ljava/lang/String;)V