问题描述
线程mainjava中的异常。 io.IOException:无法运行程序chmod:CreateProcess error = 2,系统无法在java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
处找到指定的文件
org.apache .hadoop.util.Shell.runCommand(Shell.java:149)
在org.apache.hadoop.util.Shell.run(Shell.java:134)
在org.apache.hadoop.util .Shell $ ShellCommandExecutor.execute(Shell.java:286)
在org.apache.hadoop.util.Shell.execCommand(Shell.java:354)
在org.apache.hadoop.util.Shell .execCommand(Shell.java:337)
在org.apache.hadoop.fs.RawLocalFileSystem.execCommand(RawLocalFileSystem.java:481)
在org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem的.java:473)在org.apache.hadoop.fs.FilterFileSystem.setPermission(FilterFileSystem.java:280
)
。在org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.j AVA:266)
。在org.apache.hadoop.mapred.JobClient.configureCommandLineOptions(JobClient.java:573)
。在org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:761)在org.apache.hadoop.mapreduce.Job.submit(Job.java:432)
在org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:447)
在finanalytics.ClassifyMR $ MapClass.main(ClassifyMR.java:172)
导致:java.io.IOException:CreateProcess错误= 2,系统无法在java.lang.ProcessImpl找到指定
的文件< init>(ProcessImpl.java:188)
at java.lang.ProcessImpl.start(ProcessImpl.java:132)$ b $在java.lang.ProcessImpl中。 b在java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
... 14 more
解决这个问题的方法在这里。我安装了最新版本的cygwin,但我不知道如何设置环境变量,因为我可以在该页面上提到的cygwin-chmod中找到cygwin安装目录中的任何位置。
将系统路径变量设置为位置chmod.exe
如果你已经使用windows installer安装了cygwin64,那么你的chmod.exe应该存在于
INSTALLATION_DIR \\ cygwin在我的C驱动器,所以的价值我的系统路径变量是; C:\cygwin64\bin
I am running hadoop on windows-7 64 bit and getting this error :
Exception in thread "main" java.io.IOException: Cannot run program "chmod": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
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.mapreduce.Job.submit(Job.java:432)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:447)
at finanalytics.ClassifyMR$MapClass.main(ClassifyMR.java:172)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:188)
at java.lang.ProcessImpl.start(ProcessImpl.java:132)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
... 14 more
Solution of this problem is given here http://javaprotlib.sourceforge.net/packages/io/howtofixhadoop.html. I installed latest version of cygwin but I don't know how to set environment variable because I can find cygwin-chmod any where in cygwin installed directory as mentioned on that page. How do I set this variable and what are the other configuration to run the program.
解决方案 Set the System Path Variable to the location of chmod.exeIf you have installed cygwin64 using windows installer then your chmod.exe should exist under
INSTALLATION_DIR\cygwin64\bin
For me, I have installed cygwin in my C drive, so the value of my System Path Variable is ;C:\cygwin64\bin
这篇关于在window-7 64位上运行hadoop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!