public static void setupJdk(PsiDirectory dir, PsiElement file) {
    Module module = ModuleUtilCore.findModuleForPsiElement(dir);
    if (file != null && module != null && ModuleRootManager.getInstance(module).getSdk() == null) {
      Project project = dir.getProject();
      ModuleRootModificationUtil.setSdkInherited(module);
      ProgressManager.getInstance().run(new Task.Backgroundable(project, JavaBundle.message("progress.title.looking.for.jdk"), true) {
        @Override
        public void run(@NotNull ProgressIndicator indicator) {
          SdkLookupUtil.lookupAndSetupSdkBlocking(project, indicator, JavaSdk.getInstance(), sdk -> {
            JavaSdkUtil.applyJdkToProject(project, sdk);
            Notifications.Bus.notify(new Notification("Setup SDK", JavaBundle.message("notification.content.was.set.up", sdk.getVersionString()), NotificationType.INFORMATION).addAction(
              new NotificationAction(JavaBundle.message("notification.content.change.jdk")) {
                @Override
                public void actionPerformed(@NotNull AnActionEvent e,
                                            @NotNull Notification notification) {
                  SdkPopupFactory
                    .newBuilder()
                    .withProject(project)
                    .withSdkTypeFilter(type -> type instanceof JavaSdkType)
                    .updateProjectSdkFromSelection()
                    .onPopupClosed(() -> notification.hideBalloon())
                    .buildPopup()
                    .showPopup(e);
                }
              }));
          });
        }
      });
    }
  }
public static void setupJdk(PsiDirectory dir, PsiElement file)