void () { final JavaAwareProjectJdkTableImpl table = JavaAwareProjectJdkTableImpl.getInstanceEx(); WriteAction.runAndWait(() -> { Sdk jdk = table.getInternalJdk(); if (table.findJdk(jdk.getName(), jdk.getSdkType().getName()) != jdk) { table.addJdk(jdk); } }); }