CLASSPATH issue in Hadoop on Cygwin while running "hadoop version" command CLASSPATH issue in Hadoop on Cygwin while running "hadoop version" command hadoop hadoop

CLASSPATH issue in Hadoop on Cygwin while running "hadoop version" command


you can also add the following to your ~/.bashrc

export HADOOP_CLASSPATH=$(cygpath -pw $(hadoop classpath)):$HADOOP_CLASSPATH

this solved it for me


I met the same issue when trying to install Hadoop 2.2.0 on windows 2008 Server Sp1 64bit.

I have installed cygwin64 and configured openssh.

The answer by user2870991 works for me. Modify the \hadoop\bin\hadoop script as below, comment the original exec line and insert the new one.

  #exec "$JAVA" $JAVA_HEAP_MAX $HADOOP_OPTS $CLASS "$@"  #add the -claspath "$(cygpath -pw "$CLASSPATH")" TO FIX the script running in cygwin  exec "$JAVA" -classpath "$(cygpath -pw "$CLASSPATH")" $JAVA_HEAP_MAX $HADOOP_OPTS $CLASS "$@"


Add the below statement in hadoop-config.sh @ line no 285

CLASSPATH=`cygpath -wp "$CLASSPATH"`//Comments goes hereif [ "$HADOOP_CLASSPATH" != "" ]; then  # Prefix it if its to be preceded  if [ "$HADOOP_USER_CLASSPATH_FIRST" != "" ]; then    CLASSPATH=${HADOOP_CLASSPATH}:${CLASSPATH}  else    CLASSPATH=${CLASSPATH}:${HADOOP_CLASSPATH}  fifi

Output :

admin@admin-PC /cygdrive/e/hadoop/hadoop-2.2.0/bin$ ./hadoop versionHadoop 2.2.0Subversion https://svn.apache.org/repos/asf/hadoop/common -r 1529768Compiled by hortonmu on 2013-10-07T06:28ZCompiled with protoc 2.5.0From source with checksum 79e53ce7994d1628b240f09af91e1af4This command was run using /E:/hadoop/hadoop-2.2.0/share/hadoop/common/hadoop-common-2.2.0.jar