code: public static JavadocHelper create(JavacTask mainTask, Collection<? extends Path> sourceLocations) {
          StandardJavaFileManager fm = compiler.getStandardFileManager(null, null, null);
          try {
              fm.setLocationFromPaths(StandardLocation.SOURCE_PATH, sourceLocations);
              return new OnDemandJavadocHelper(mainTask, fm);
          } catch (IOException ex) {
              try {
                  fm.close();
              } catch (IOException closeEx) {
              }
              return new JavadocHelper() {
                  @Override
                  public String getResolvedDocComment(Element forElement) throws IOException {
                      return null;
                  }
                  @Override
                  public Element getSourceElement(Element forElement) throws IOException {
                      return forElement;
                  }
                  @Override
                  public void close() throws IOException {}
              };
          }
      }
docs: Create the helper.
  
  @param mainTask JavacTask from which the further Elements originate
  @param sourceLocations paths where source files should be searched
  @return a JavadocHelper