How to resolve java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FsShell error.
bash-3.00$ hadoop dfs -ls
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FsShell
Solution:
Run following command and check whether jar hadoop-common-2.0.2-alpha-gphd-2.0.1.0.jar is in classpath.
$hadoop classpath
if given jar is not in the classpath then add following entry in hadoop-env.sh
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:YOUR-PATH/hadoop-2.0.2-alpha-gphd-2.0.1.0/share/hadoop/common/hadoop-common-2.0.2-alpha-gphd-2.0.1.0.jar
bash-3.00$ hadoop dfs -ls
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FsShell
Solution:
Run following command and check whether jar hadoop-common-2.0.2-alpha-gphd-2.0.1.0.jar is in classpath.
$hadoop classpath
if given jar is not in the classpath then add following entry in hadoop-env.sh
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:YOUR-PATH/hadoop-2.0.2-alpha-gphd-2.0.1.0/share/hadoop/common/hadoop-common-2.0.2-alpha-gphd-2.0.1.0.jar