void (ActionEvent e) { final Sdk jdk = getJdk(); final Runnable runnable = () -> ProjectRootManagerEx.getInstanceEx(defaultProject).setProjectSdk(jdk); ApplicationManager.getApplication().runWriteAction(runnable); mySetAsDefaultButton.setEnabled(false); }