Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JAR does not exist or is not a normal file

While running the wordcount example in Hadoop, I am facing the following error.

saying "JAR does not exist or is not a normal file: 
/usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduceexamples-2.2.0.jar"

My input command was :

hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduceexamples-2.2.0.jar  wordcount input output
like image 490
Srijan Gupta Avatar asked Jun 15 '18 11:06

Srijan Gupta


3 Answers

Just go to that path and check it out if the name is correct or not, the convention may differ by the distribution.

For example, hadoop 3.1.0 has it in the following path:

$HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.0.jar

like image 110
aysegulpekel Avatar answered Oct 05 '22 15:10

aysegulpekel


I faced the same problem and problem was with the version number in file. For example, in the installation instructions, the command was:

bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.2.1.jar grep input output 'dfs[a-z.]+'

While the version I'm working with was 3.1.3 so what worked for me was:

bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.3.jar grep input output 'dfs[a-z.]+'

like image 31
DevLoverUmar Avatar answered Oct 05 '22 14:10

DevLoverUmar


Just check whether all the dependencies are included in your jar file. Try something like this.

hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduceexamples-2.2.0-jar-with-dependencies.jar  wordcount input output
like image 39
Kasun Kariyawasam Avatar answered Oct 05 '22 14:10

Kasun Kariyawasam