@Nullable
  public static Sdk setupSdk(Sdk @NotNull [] allSdks,
                             @NotNull VirtualFile homeDir,
                             @NotNull SdkType sdkType,
                             final boolean silent,
                             @Nullable final SdkAdditionalData additionalData,
                             @Nullable final String customSdkSuggestedName) {
    Sdk sdk = null;
    try {
      sdk = setupSdk(allSdks, homeDir, sdkType, additionalData, customSdkSuggestedName);
    }
    catch (ProcessCanceledException e) {
      throw e;
    }
    catch (Throwable e) {
      LOG.warn("Error creating or configuring sdk: homeDir=[" + homeDir + "]; " +
               "sdkType=[" + sdkType + "]; " +
               "additionalData=[" + additionalData + "]; " +
               "customSdkSuggestedName=[" + customSdkSuggestedName + "]; " +
               "sdk=[" + sdk + "]", e);
      if (!silent) {
        ApplicationManager.getApplication().invokeLater(
          () ->
            Messages.showErrorDialog(
              ProjectBundle.message(
                "dialog.message.error.configuring.sdk.0.please.make.sure.that.1.is.a.valid.home.path.for.this.sdk.type",
                e.getMessage(),
                FileUtil.toSystemDependentName(homeDir.getPath())
              ),
              ProjectBundle.message("dialog.title.error.configuring.sdk")
            )
        );
      }
      return null;
    }
    return sdk;
  }
@Nullable
  public static Sdk setupSdk(Sdk @NotNull [] allSdks,
                             @NotNull VirtualFile homeDir,
                             @NotNull SdkType sdkType,
                             final boolean silent,
                             @Nullable final SdkAdditionalData additionalData,
                             @Nullable final String customSdkSuggestedName)