void () { mySandboxHome.addCurrentTextToHistory(); final Sandbox additionalData = (Sandbox)myIdeaJdk.getSdkAdditionalData(); if (additionalData != null) { additionalData.cleanupWatchedRoots(); } Sandbox sandbox = new Sandbox(mySandboxHome.getText(), (Sdk)myInternalJres.getSelectedItem(), myIdeaJdk); final SdkModificator modificator = myIdeaJdk.getSdkModificator(); modificator.setSdkAdditionalData(sandbox); ApplicationManager.getApplication().runWriteAction(modificator::commitChanges); ((ProjectJdkImpl) myIdeaJdk).resetVersionString(); myModified = false; }