public String getExecJarPathLocal(Configuration configuration) {
    try {
      // returns the location on disc of the jar of this class.
      String uri = DagUtils.class.getProtectionDomain().getCodeSource().getLocation().toURI().toString();
      if (uri.endsWith(".jar")) {
        return uri;
      }
    } catch (Exception ignored) {}
    //Fall back to hive config, if the uri could not get, or it does not point to a .jar file
    String jar = configuration.get(ConfVars.HIVE_JAR.varname);
    if (!StringUtils.isBlank(jar)) {
      return jar;
    }
    throw new RuntimeException("Could not get hive-exec local path");
  }
Localizes files, archives and jars from a provided array of names.
@param hdfsDirPathStr Destination directory in HDFS.
@param conf Configuration.
@param inputOutputJars The file names to localize.
@return Map&lt;String, LocalResource&gt; (srcPath, local resources) to add to execution
@throws IOException when hdfs operation fails.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java