Hadoop-Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster

hadoop 环境下运行MapReduce 下wordCount出现以下错误:
Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMasterHadoop-Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster_第1张图片
根据报错提示
找到hadoop安装目录下$HADOOP_HOME/etc/mapred-site.xml,增加以下代码


  yarn.app.mapreduce.am.env
  HADOOP_MAPRED_HOME=${HADOOP_HOME}


  mapreduce.map.env
  HADOOP_MAPRED_HOME=${HADOOP_HOME}


  mapreduce.reduce.env
  HADOOP_MAPRED_HOME=${HADOOP_HOME}

Hadoop-Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster_第2张图片
最后运行成功
Hadoop-Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster_第3张图片

你可能感兴趣的:(Hadoop)