2

I am new to Hadoop and trying to run it on Windows 7. Whenever I am trying to run hadoop bash script, I get the following error :

'-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.

Also, when I run hdfs command , I get the following error :

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

When I try to pass -Xmx and -Xms arguments, I get the following message :

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

Can anyone help me out on this ?

AppleBud
  • 1,501
  • 8
  • 31
  • 47
  • Are you passing the -Xms -Xmx arguments yourself ? These are arguments for the jvm, requesting memory http://stackoverflow.com/a/14763095/1413133 – Manos Nikolaidis Oct 11 '15 at 13:26
  • No, I am not passing these arguments myself. Also, as per the link you shared @ManosNikolaidis , i get this message : Error occurred during initialization of VM Could not reserve enough space for object heap – AppleBud Oct 11 '15 at 13:28
  • The error message sounds straightforward. `-Xms1000m` means you are requesting 1GB or RAM. Does your system 1GB free ? – Manos Nikolaidis Oct 11 '15 at 13:41
  • Yes I do have that much memory available. So, for now, lets say I dont have this much space but what about this error: -Xms32m is not recognized as an internal or external command ? – AppleBud Oct 11 '15 at 13:45
  • check this https://stackoverflow.com/a/70630733/6236959 – Shubham Kumar Gupta Jan 08 '22 at 08:35

1 Answers1

1

The error message

is not recognized as an internal or external command

indicates that you attempted to run from the command line a program that Windows doesn't recognize. This likely has nothing to do with -Xms and -Xmx. The problem is Windows cannot find java.

Make sure you can ran java -version no matter what's the current folder you are in. If you can't, you need to add the java at the PATH environment variable.

This could also be an issue of installing java or hadoop in a folder that has spaces in the path e.g. C:\Program Files has a space in the folder and that can be a problem. If that's the cause then install java and hadoop on a different folder without spaces in the path.

Manos Nikolaidis
  • 21,608
  • 12
  • 74
  • 82
  • Hi.. Your above suggestion worked perfectly fine. However, now i am facing this issue : http://stackoverflow.com/questions/33211599/hadoop-error-on-windows-java-lang-unsatisfiedlinkerror --- Can you help please ? – AppleBud Oct 27 '15 at 04:41