String (@NotNull String jdkInstallationPath) { String sdkName = ExternalSystemJdkProvider.getInstance().getJavaSdkType().suggestSdkName(null, jdkInstallationPath); ProjectJdkTable jdkTable = ProjectJdkTable.getInstance(); Sdk sdk = ReadAction.compute(() -> ContainerUtil.find(jdkTable.getAllJdks(), candidate -> jdkInstallationPath.equals(candidate.getHomePath()) || sdkName.equals(candidate.getName()))); if (sdk != null) { return sdk.getName(); } final Sdk effectiveSdk = ExternalSystemJdkProvider.getInstance().createJdk(sdkName, jdkInstallationPath); ApplicationManager.getApplication().invokeAndWait(() -> SdkConfigurationUtil.addSdk(effectiveSdk)); return effectiveSdk.getName(); }