JetBrains/intellij-community · error · ConfigurationException
Enter a file name to create a new {0} {1}
Error message
Enter a file name to create a new {0} {1} What it means
Thrown by ProjectNameStep.validate() when the wizard step's project name field is empty. Same underlying rule as NamePathComponent: a name is required to derive the project file/directory, and this step surfaces it before any path checks.
Source
Thrown at java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectNameStep.java:107
}
@Override
public void updateDataModel() {
myWizardContext.setProjectName(getProjectName());
myWizardContext.setProjectFileDirectory(getProjectFileDirectory());
}
@Override
public Icon getIcon() {
return myWizardContext.getStepIcon();
}
@Override
public boolean validate() throws ConfigurationException {
String name = myNamePathComponent.getNameValue();
if (name.isEmpty()) {
ApplicationNamesInfo info = ApplicationNamesInfo.getInstance();
throw new ConfigurationException(JavaUiBundle.message("prompt.new.project.file.name", info.getFullProductName(), myWizardContext.getPresentationName()));
}
final String projectFileDirectory = getProjectFileDirectory();
if (projectFileDirectory.isEmpty()) {
throw new ConfigurationException(JavaUiBundle.message("prompt.enter.project.file.location", myWizardContext.getPresentationName()));
}
final boolean shouldPromptCreation = myNamePathComponent.isPathChangedByUser();
String prefix = JavaUiBundle.message("directory.project.file.directory", myWizardContext.getPresentationName());
if (!ProjectWizardUtil.createDirectoryIfNotExists(prefix, projectFileDirectory, shouldPromptCreation)) {
return false;
}
boolean shouldContinue = true;
final String path = myWizardContext.isCreatingNewProject() && myWizardContext.getProjectStorageFormat() == DIRECTORY_BASED
? getProjectFileDirectory() + "/" + Project.DIRECTORY_STORE_FOLDER : getProjectFilePath();
final File projectFile = new File(path);View on GitHub (pinned to be881553f2)
Solutions
- Enter a project name in the first wizard step
- Set a default via wizardContext.setProjectName("untitled") when constructing the wizard programmatically
- Guard Finish button enablement on !name.isEmpty() for earlier feedback
Example fix
// before
WizardContext ctx = new WizardContext(null, new WizardStartupSettings(...));
new ProjectNameStep(ctx).validate(); // ConfigurationException: enter a file name
// after
ctx.setProjectName("my-app");
new ProjectNameStep(ctx).validate(); Defensive patterns
Strategy: validation
Validate before calling
if (step.getNamePathComponent().getNameValue().isEmpty()) {
wizardContext.setProjectName("untitled"); // or block Next
}
step.validate(); Prevention
- Always set a default project name on the WizardContext before showing ProjectNameStep
- Bind Finish enablement to name-field emptiness
When it happens
Trigger: Wizard reaches ProjectNameStep.validate() while myNamePathComponent.getNameValue() returns the empty string (name field cleared or never pre-filled).
Common situations: New Project wizard with the name field left blank after user deletes the default; custom wizard chains that insert ProjectNameStep without a default name in the WizardContext; keyboard-driven Finish.
Related errors
- Enter a file name to create a new {0} {1}
- Enter {0} file location
- Enter {0} file location
- Enter module file location
- Enter a module name
AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14).
Data as JSON: /api/errors/a9909ac4abdc2727.
Report an issue: GitHub.