private String getShimLibjars() {
    WebHCatJTShim shim = null;
    UserGroupInformation ugi = null;
    try {
      ugi = UserGroupInformation.getCurrentUser();
      shim = ShimLoader.getHadoopShims().getWebHCatShim(appConf, ugi);

      // Besides the HiveShims jar which is Hadoop version dependent we also
      // always need to include hive shims common jars.
      Path shimCommonJar = new Path(
          TempletonUtils.findContainingJar(ShimLoader.class, HIVE_SHIMS_FILENAME_PATTERN));
      Path shimCommonSecureJar = new Path(
          TempletonUtils.findContainingJar(HadoopShimsSecure.class, HIVE_SHIMS_FILENAME_PATTERN));
      Path shimJar = new Path(
          TempletonUtils.findContainingJar(shim.getClass(), HIVE_SHIMS_FILENAME_PATTERN));

      return String.format(
          "%s,%s,%s",
          shimCommonJar.toString(), shimCommonSecureJar.toString(), shimJar.toString());
    } catch (IOException e) {
      throw new RuntimeException("Failed to get shimLibJars", e);
    } finally {
      try {
        if (ugi != null) {
          FileSystem.closeAllForUGI(ugi);
        }
      } catch (IOException e) {
        throw new RuntimeException("Failed to closeAllForUGI", e);
      }
    }

  }
Dynamically determine the list of hive shim jars that need to be added
to the Templeton launcher job classpath.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/LauncherDelegator.java