{"record":{"id":"5bd7ec206df63469","repo":"JetBrains/intellij-community","slug":"please-specify-sdk-name","errorCode":null,"errorMessage":"Please specify SDK name","messagePattern":"Please specify SDK name","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"java/idea-ui/src/com/intellij/openapi/projectRoots/ui/SdkEditor.java","lineNumber":238,"sourceCode":"    }\n    return isModified;\n  }\n\n  public void setNewSdkName(String name) {\n    myModifiedName = name;\n  }\n\n  public @NlsSafe String getActualSdkName() {\n    return myModifiedName;\n  }\n\n  @Override\n  public void apply() throws ConfigurationException {\n    if (myIsDownloading) return;\n\n    if (!Objects.equals(myInitialName, myModifiedName)) {\n      if (myModifiedName.isEmpty()) {\n        throw new ConfigurationException(ProjectBundle.message(\"sdk.list.name.required.error\"));\n      }\n    }\n    myInitialName = myModifiedName;\n    myInitialPath = mySdk.getHomePath();\n    SdkModificator sdkModificator = mySdk.getSdkModificator();\n    sdkModificator.setName(myModifiedName);\n    sdkModificator.setHomePath(FileUtil.toSystemIndependentName(getHomeValue()));\n    for (SdkPathEditor pathEditor : myPathEditors.values()) {\n      pathEditor.apply(sdkModificator);\n    }\n    ApplicationManager.getApplication().runWriteAction(sdkModificator::commitChanges);\n    for (final AdditionalDataConfigurable configurable : getAdditionalDataConfigurable()) {\n      if (configurable != null) {\n        configurable.apply();\n      }\n    }\n  }\n","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/idea-ui/src/com/intellij/openapi/projectRoots/ui/SdkEditor.java#L220-L256","documentation":"Thrown by SdkEditor.apply() when the user renamed an SDK to an empty string (myModifiedName is empty and differs from myInitialName). SDK entries need a non-empty name — it is how run configurations and modules reference them — so the Project Structure dialog refuses to commit an empty rename.","triggerScenarios":"Calling apply() on SdkEditor after the name field was changed from a non-empty initial value to empty (myIsDownloading false, Objects.equals(initial, modified) false, modified.isEmpty() true).","commonSituations":"User clears the SDK name field in File > Project Structure > SDKs and clicks OK/Apply; accidental select-all + typing; programmatic editing of the SDK editor without setting a name.","solutions":["Enter a non-empty SDK name in the name field and apply again","If you meant to remove the SDK, delete it from the SDKs list instead of blanking its name","In plugin code, guard before apply: if (editor.getActualSdkName().isEmpty()) return/notify"],"exampleFix":"// before\nSdkEditor editor = ...;\neditor.setName(\"\"); // cleared the field\neditor.apply(); // ConfigurationException: Please specify SDK name\n\n// after\neditor.setName(\"corretto-21\");\neditor.apply();","handlingStrategy":"validation","validationCode":"if (editor.getActualSdkName() != null && editor.getActualSdkName().isEmpty()) {\n  // restore previous name or block Apply with a message\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never leave the SDK name field blank in Project Structure; use delete instead","In code paths that edit SDKs, assert a non-empty name before apply()"],"tags":["sdk","project-structure","validation","intellij"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}