0
votes

I am trying to configure Hadoop 2.5.1 on my windows machine using cygwin. But whenever i try to run the command

hdfs namenode -format

the following error occurs

Error: Could not find or load main class org.apache.hadoop.hdfs.server.namenode.NameNode

I have set the JAVA_HOME as

H:\cygwin\usr\local\Java

both in bashrc as well as in hadoop-env.sh. Can anyone help me as which part I might be going wrong at ???

1

1 Answers

1
votes

Hy, I have the same problem, however I solved other problems I had, on Windows with Cygwin you have to:

  1. Make sure you install Java JDK in a folder that does not contain white space
  2. Keep path closer to the root C:\
  3. With Cygwin C:\ is translated as /cygdrive/c/ NOTE that the (slash) must be Linux-style / instead of Microsoft-style \ (back-slash)
  4. Edit the .bashrc file located C:\cygwin\home\username\.bashrc


    export JAVA_HOME=/cygdrive/c/Program_Files/Java/jdk1.7.0_71
    export PATH=$PATH:$JAVA_HOME/bin
    export M2_HOME=/cygdrive/c/maven
    export PATH=$PATH:$M2_HOME/bin
    export Platform=x64
    export HADOOP_HOME=/cygdrive/c/cygwin/usr/local/hadoop
    export HADOOP_INSTALL=/cygdrive/c/cygwin/usr/local/hadoop
    export PATH=$PATH:$HADOOP_INSTALL/bin
    export PATH=$PATH:$HADOOP_INSTALL/sbin
    export HADOOP_MAPRED_HOME=$HADOOP_INSTALL
    export HADOOP_COMMON_HOME=$HADOOP_INSTALL
    export HADOOP_HDFS_HOME=$HADOOP_INSTALL
    export YARN_HOME=$HADOOP_INSTALL
    export HADOOP_CONFIG_DIRECTORY=/cygdrive/c/hadoop/etc/hadoop

Good luck!