无法在Windows 7上运行Hadoop

时间:2015-10-11 13:18:02

标签: windows hadoop

我是Hadoop的新手并试图在Windows 7上运行它。 每当我尝试运行hadoop bash脚本时,我都会收到以下错误:

'-Xmx32m' is not recognized as an internal or external command,
operable program or batch file.
Usage: hadoop [--config confdir] COMMAND
where COMMAND is one of:
  fs                   run a generic filesystem user client
  version              print the version
  jar <jar>            run a jar file
  checknative [-a|-h]  check native hadoop and compression libraries availability
  distcp <srcurl> <desturl> copy file or directories recursively
  archive -archiveName NAME -p <parent path> <src>* <dest> create a hadoop archive
  classpath            prints the class path needed to get the
                       Hadoop jar and the required libraries
  credential           interact with credential providers
  key                  manage keys via the KeyProvider
  daemonlog            get/set the log level for each daemon
 or
  CLASSNAME            run the class named CLASSNAME

Most commands print help when invoked w/o parameters.

另外,当我运行hdfs命令时, 我收到以下错误:

-Xms1000m is not recognized as in internal or external command.

当我尝试传递-Xmx和-Xms参数时,我收到以下消息:

Error occurred during initialization of VM
Could not reserve enough space for object heap

任何人都可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

错误消息

  

未被识别为内部或外部命令

表示您试图从命令行运行Windows无法识别的程序。这可能与-Xms和-Xmx无关。问题是Windows无法找到java。

确保无论您当前所在的文件夹是什么,都可以运行java -version。如果您不能,则需要在PATH环境变量中添加java。

这也可能是在路径中包含空格的文件夹中安装java或hadoop的问题,例如C:\Program Files在文件夹中有一个空格,这可能是个问题。如果这是原因,那么在路径上没有空格的不同文件夹上安装java和hadoop。