Include Third Party Jars in Hadoop -


i new hadoop. have added gson api mapreducing program. when running program getting;

error: java.lang.classnotfoundexception: com.google.gson.gson 

can suggest me how add third party libraries hadoop?

be sure add dependencies both hadoop_classpath , -libjars upon submitting job in following examples:

use following add jar dependencies current , lib directories:

export hadoop_classpath=$hadoop_classpath:`echo *.jar`:`echo lib/*.jar | sed 's/ /:/g'` 

bear in mind when starting job through hadoop jar you'll need pass jars of dependencies through use of -libjars. use:

hadoop jar <jar> <class> -libjars `echo ./lib/*.jar | sed 's/ /,/g'` [args...] 

note: sed commands require different delimiter character; hadoop_classpath : separated , -libjars need , separated.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -