private void addLibraries(@NotNull File dir) {
    LOG.debug("addLibraries: " + dir.getAbsolutePath() + ", exists: " + dir.exists());
    File[] subFiles = dir.listFiles();
    if (subFiles == null) {
      LOG.warn("Can't list files in " + dir);
      return;
    }

    for (File file : subFiles) {
      if (file.isDirectory()) {
        addLibraries(file);
      }
      else if (file.getName().endsWith(".jar")) {
        addFile(file);
      }
    }
  }
private void addLibraries(@NotNull File dir)