Sdk (String jdkPath) { Sdk sdk = ContainerUtil.find(ProjectJdkTable.getInstance().getAllJdks(), it -> jdkPath.equals(it.getHomePath())); ProjectJdkTable jdkTable = ProjectJdkTable.getInstance(); for (Sdk existingSdk : jdkTable.getAllJdks()) { if (existingSdk == sdk) return sdk; } Sdk newSdk = JavaSdk.getInstance().createJdk("Wsl JDK For Tests", jdkPath); WriteAction.runAndWait(() -> jdkTable.addJdk(newSdk, myProject)); return newSdk; }