運行map reduce任務報錯:java
(null) entry in command string: null chmod 0700apache
解決辦法:windows
在https://download.csdn.net/download/xiaoliu123586/10551225oop
中下載winutils.exe,libwinutils.lib 拷貝到%HADOOP_HOME%\bin目錄 。spa
再次執行程序,報錯:.net
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z
at org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Native Method)
at org.apache.hadoop.io.nativeio.NativeIO$Windows.access(NativeIO.java:609)
at org.apache.hadoop.fs.FileUtil.canRead(FileUtil.java:977)
at org.apache.hadoop.util.DiskChecker.checkAccessByFileMethods(DiskChecker.java:187)
at org.apache.hadoop.util.DiskChecker.checkDirAccess(DiskChecker.java:174)
at org.apache.hadoop.util.DiskChecker.checkDir(DiskChecker.java:108)
at org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.confChanged(LocalDirAllocator.java:285)
at org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.getLocalPathForWrite(LocalDirAllocator.java:344)
at org.apache.hadoop.fs.LocalDirAllocator.getLocalPathForWrite(LocalDirAllocator.java:150)
在https://download.csdn.net/download/xiaoliu123586/10551225 中下載hadoop.dll,並拷貝到c:\windows\system32目錄中。code
執行map reduce程序, 正常。hadoop
注意:程序中的路徑都要寫windows文件系統中的路徑了,再也不是hdfs中的路徑。get