Make sure you call job.setJarByClass with right parameters. 
http://stackoverflow.com/questions/3912267/hadoop-query-regarding-setjarbyclass-method-of-job-class

Other than that, try to do 2 and 3 together just to test it out. There is no 
reason it doesn’t work.

From: Todd [mailto:bit1...@163.com]
Sent: Tuesday, December 22, 2015 12:01 AM
To: user@hadoop.apache.org
Subject: [Classpath Issue]NoClassFoundException occurs when depending on the 
3rd jar

Hi,
I have two jars, A and B. A contains the class that has the main method, B 
contains the mapper and reducer. A will collect B's mapper and reducer through 
reflection.
I am using the following commands to submit the job,but B's mapper class not 
found exception is thrown.
1.
$HADOOP_CLASSPATH=B.jar:other jars
hadoop jar A.jar

2. HADOOP_CLASSPATH=B.jar:other jars;hadoop jar A.jar
3. hadoop jar A.jar -libjars B.jar

All the above three ways don't work. Can someone help me on this? Thanks!!

This email and any attachments transmitted with it are intended for use by the 
intended recipient(s) only. If you have received this email in error, please 
notify the sender immediately and then delete it. If you are not the intended 
recipient, you must not keep, use, disclose, copy or distribute this email 
without the author’s prior permission. We take precautions to minimize the risk 
of transmitting software viruses, but we advise you to perform your own virus 
checks on any attachment to this message. We cannot accept liability for any 
loss or damage caused by software viruses. The information contained in this 
communication may be confidential and may be subject to the attorney-client 
privilege.

Reply via email to