private static String getJar(Class<?> my_class) {
    String ret = null;
    String hadoopJarFinder = "org.apache.hadoop.util.JarFinder";
    Class<?> jarFinder = null;
    try {
      log.debug("Looking for: {}", hadoopJarFinder);
      jarFinder = JavaUtils.loadClass(hadoopJarFinder);
      log.debug("Found: {}", hadoopJarFinder);
      Method getJar = jarFinder.getMethod("getJar", Class.class);
      ret = (String) getJar.invoke(null, my_class);
    } catch (ClassNotFoundException e) {
      log.debug("Using backported JarFinder.");
      ret = jarFinderGetJar(my_class);
    } catch (InvocationTargetException e) {
      // function was properly called, but threw it's own exception.
      // Unwrap it
      // and pass it on.
      throw new RuntimeException(e.getCause());
    } catch (Exception e) {
      // toss all other exceptions, related to reflection failure
      throw new RuntimeException("getJar invocation failed.", e);
    }

    return ret;
  }
Invoke 'getJar' on a JarFinder implementation. Useful for some job configuration contexts
(HBASE-8140) and also for testing on MRv2. First check if we have HADOOP-9426. Lacking that,
fall back to the backport.

@param my_class
         the class to find.
@return a jar file that contains the class, or null.
ql/src/java/org/apache/hadoop/hive/ql/metadata/JarUtils.java