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
- 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
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
- 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()
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
- module.paths.validation.source.root.belongs.to.another.module.error
- library.name.is.not.specified
- Offset out of range (from -12:00 to +14:00)
- No JDK specified
- Home directory is not specified for JDK
AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14).
Data as JSON: /api/errors/5bd7ec206df63469.
Report an issue: GitHub.