public static void addJarsToJob ( Configuration conf , Class ... klasses ) { // Build set of jars that needs to be added, order doesn't matter for us and we will remove duplicates Set < String > additinonalJars = new HashSet <> ( ) ; for ( Class klass : klasses ) { final String jar = jarForClass ( klass ) ; LOG . info ( "Adding jar {} for class {}" , jar , klass . getCanonicalName ( ) ) ; additinonalJars . add ( jar ) ; } appendJars ( conf , additinonalJars ) ; }
Add jars containing the following classes to the job s classpath .