void (Sdk jdk) { ProjectJdkTable jdkTable = ProjectJdkTable.getInstance(); for (Sdk existingSdk : jdkTable.getAllJdks()) { if (existingSdk == jdk) return; } WriteAction.runAndWait(()-> jdkTable.addJdk(jdk, myProject)); }