在cygwin部署hadoop出现的问题:$ ./bin/hadoop version 显示错误: 找不到或无法加载主类 org.apache.hadoop.util.VersionInfo

时间:2022-11-22 22:55:52

解决方案

找到hadoop主目录的bin文件夹下的hadoop文件,将倒数第二行

exec "$JAVA" $JAVA_HEAP_MAX $HADOOP_OPTS $CLASS "$@"

改成

exec "$JAVA" -classpath "$(cygpath -pw "$CLASSPATH")" $JAVA_HEAP_MAX $HADOOP_OPTS $CLASS "$@"

就可以了

ps:

我按这个方法解决了

http://*.com/questions/19363402/classpath-issue-in-hadoop-on-cygwin-while-running-hadoop-version-command