在eclipse下运行mapreduce程序的时候报这个错误。
Exception in thread "main" java.io.IOException: Cannot run program "chmod": CreateProcess error=2, ?????????
at java.lang.ProcessBuilder.start(Unknown Source)at org.apache.hadoop.util.Shell.runCommand(Shell.java:149)
at org.apache.hadoop.util.Shell.run(Shell.java:134)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:286)
at org.apache.hadoop.util.Shell.execCommand(Shell.java:354)
at org.apache.hadoop.util.Shell.execCommand(Shell.java:337)
at org.apache.hadoop.fs.RawLocalFileSystem.execCommand(RawLocalFileSystem.java:481)
at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:473)
at org.apache.hadoop.fs.FilterFileSystem.setPermission(FilterFileSystem.java:280)
at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:266)
at org.apache.hadoop.mapred.JobClient.configureCommandLineOptions(JobClient.java:573)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:761)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:730)
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1249)
at com.aspire.analyzer.hdfs.MobilePhoneTypeCount2.run(MobilePhoneTypeCount2.java:167)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
at com.aspire.analyzer.hdfs.MobilePhoneTypeCount2.main(MobilePhoneTypeCount2.java:197)
Caused by: java.io.IOException: CreateProcess error=2, ?????????
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 18 more
查了下应该是要装cygwin,这个就不说了网上多的是,只是要注意一下两点
1. 进入select package界面勾选“openssl,openssh”如下图:
2. 进入base default下的“sed”如下图:
最后就是将“D:\Program Files\cygwin\bin”添加环境变量。