JetBrains/intellij-community · error · ConfigurationException

Please specify SDK name

Error message

Please specify SDK name

What it means

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.

Source

Thrown at java/idea-ui/src/com/intellij/openapi/projectRoots/ui/SdkEditor.java:238

    }
    return isModified;
  }

  public void setNewSdkName(String name) {
    myModifiedName = name;
  }

  public @NlsSafe String getActualSdkName() {
    return myModifiedName;
  }

  @Override
  public void apply() throws ConfigurationException {
    if (myIsDownloading) return;

    if (!Objects.equals(myInitialName, myModifiedName)) {
      if (myModifiedName.isEmpty()) {
        throw new ConfigurationException(ProjectBundle.message("sdk.list.name.required.error"));
      }
    }
    myInitialName = myModifiedName;
    myInitialPath = mySdk.getHomePath();
    SdkModificator sdkModificator = mySdk.getSdkModificator();
    sdkModificator.setName(myModifiedName);
    sdkModificator.setHomePath(FileUtil.toSystemIndependentName(getHomeValue()));
    for (SdkPathEditor pathEditor : myPathEditors.values()) {
      pathEditor.apply(sdkModificator);
    }
    ApplicationManager.getApplication().runWriteAction(sdkModificator::commitChanges);
    for (final AdditionalDataConfigurable configurable : getAdditionalDataConfigurable()) {
      if (configurable != null) {
        configurable.apply();
      }
    }
  }

View on GitHub (pinned to be881553f2)

Solutions

  1. Enter a non-empty SDK name in the name field and apply again
  2. If you meant to remove the SDK, delete it from the SDKs list instead of blanking its name
  3. In plugin code, guard before apply: if (editor.getActualSdkName().isEmpty()) return/notify

Example fix

// before
SdkEditor editor = ...;
editor.setName(""); // cleared the field
editor.apply(); // ConfigurationException: Please specify SDK name

// after
editor.setName("corretto-21");
editor.apply();
Defensive patterns

Strategy: validation

Validate before calling

if (editor.getActualSdkName() != null && editor.getActualSdkName().isEmpty()) {
  // restore previous name or block Apply with a message
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14). Data as JSON: /api/errors/5bd7ec206df63469. Report an issue: GitHub.