標籤:style blog http java color strong 檔案 io
按照文檔:http://www.micmiu.com/bigdata/hadoop/hadoop2x-eclipse-mapreduce-demo/安裝配置好Eclipse後,運行WordCount程式報錯:
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).log4j:WARN Please initialize the log4j system properly.log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.Exception in thread "main" java.lang.NullPointerException at java.lang.ProcessBuilder.start(ProcessBuilder.java:1011) at org.apache.hadoop.util.Shell.runCommand(Shell.java:404) at org.apache.hadoop.util.Shell.run(Shell.java:379) at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:589) at org.apache.hadoop.util.Shell.execCommand(Shell.java:678) at org.apache.hadoop.util.Shell.execCommand(Shell.java:661) at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:639) at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:435) at org.apache.hadoop.fs.FilterFileSystem.mkdirs(FilterFileSystem.java:277) at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmissionFiles.java:125) at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:344) at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1268) at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1265) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491) at org.apache.hadoop.mapreduce.Job.submit(Job.java:1265) at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1286) at com.telchina.hadoop.WordCount.main(WordCount.java:84)
經過google,發現http://www.uniorder.com/2014/03/31/%E5%9C%A8%20Windows%20%E4%B8%8A%E4%BD%BF%E7%94%A8%20Eclipse%20%E8%BF%9C%E7%A8%8B%E8%B0%83%E8%AF%95%20Hadoop%202.2%20MapReduce%20%E7%A8%8B%E5%BA%8F/中:
下載 Hadoop 2.2 到你的 Windows 機器上(我是 Windows 7)並設定環境變數:HADOOP_HOME=你的Hadoop所在目錄,再在Path中加入%HADOOP_HOME%\bin;。此時還沒有完成。你需要去下載一些檔案覆蓋 Hadoop/bin 下的所有檔案(戳這裡)。
問題解決。
sdjnzqr
出處:http://www.cnblogs.com/sdjnzqr/
著作權:本文著作權歸作者和部落格園共有
轉載:歡迎轉載,但未經作者同意,必須保留此段聲明;必須在文章中給出原文串連;否則必究法律責任