code: public void setJarByClass(Class cls) {
      String jar = findContainingJar(cls);
      if (jar != null) {
        setJar(jar);
      }
    }
docs: Set the job's jar file by finding an example class location.
  
  @param cls the example class.