JetBrains/intellij-community · error · ConfigurationException
Enter {0} file location
Error message
Enter {0} file location What it means
Thrown by NamePathComponent.validateNameAndPath() when the project directory path field is empty or whitespace-only. Without a location the wizard cannot create the project directory or place the project file, so validation prompts for the location.
Source
Thrown at java/idea-ui/src/com/intellij/ide/util/projectWizard/NamePathComponent.java:157
String baseDir = context.getProjectFileDirectory();
String projectName = context.getProjectName();
String initialProjectName = projectName != null ? projectName : ProjectWizardUtil.findNonExistingFileName(baseDir, "untitled", "");
component.setPath(projectName == null ? (baseDir + File.separator + initialProjectName) : baseDir);
component.setNameValue(initialProjectName);
component.getNameComponent().select(0, initialProjectName.length());
return component;
}
public boolean validateNameAndPath(WizardContext context, boolean defaultFormat) throws ConfigurationException {
String name = getNameValue();
if (StringUtil.isEmptyOrSpaces(name)) {
ApplicationNamesInfo info = ApplicationNamesInfo.getInstance();
throw new ConfigurationException(JavaUiBundle.message("prompt.new.project.file.name", info.getFullProductName(), context.getPresentationName()));
}
String projectDirectoryPath = getPath();
if (StringUtil.isEmptyOrSpaces(projectDirectoryPath)) {
throw new ConfigurationException(JavaUiBundle.message("prompt.enter.project.file.location", context.getPresentationName()));
}
if (myShouldBeAbsolute && !new File(projectDirectoryPath).isAbsolute()) {
throw new ConfigurationException(JavaUiBundle.message("file.location.should.be.absolute", StringUtil.capitalize(context.getPresentationName())));
}
boolean shouldPromptCreation = isPathChangedByUser();
String message = JavaUiBundle.message("directory.project.file.directory", context.getPresentationName());
if (!ProjectWizardUtil.createDirectoryIfNotExists(message, projectDirectoryPath, shouldPromptCreation)) {
return false;
}
File projectDirectory = new File(projectDirectoryPath);
if (projectDirectory.exists() && !projectDirectory.canWrite()) {
throw new ConfigurationException(JavaUiBundle.message("project.directory.is.not.writable", projectDirectoryPath));
}
for (Project p : ProjectManager.getInstance().getOpenProjects()) {
if (ProjectUtil.isSameProject(projectDirectory.toPath(), p)) {
throw new ConfigurationException(JavaUiBundle.message("project.directory.is.already.taken", projectDirectoryPath, p.getName()));View on GitHub (pinned to be881553f2)
Solutions
- Enter or restore the project location path in the wizard
- Use the '...' browse button to re-select a directory so the field is repopulated canonically
- In plugin code, always call component.setPath(baseDir + File.separator + name) before validate()
Example fix
// before
component.setNameValue("my-app");
// path field empty
component.validateNameAndPath(context, true); // ConfigurationException: enter file location
// after
component.setNameValue("my-app");
component.setPath("/home/user/IdeaProjects/my-app");
component.validateNameAndPath(context, true); Defensive patterns
Strategy: validation
Validate before calling
if (component.getPath() == null || component.getPath().trim().isEmpty()) {
component.setPath(baseDir + File.separator + suggestedName);
}
component.validateNameAndPath(context, true); Prevention
- Always initialize the path field from the previously selected parent directory
- Re-derive path from name on every name change if the user has not customized it
When it happens
Trigger: Calling validateNameAndPath(context, defaultFormat) while getPath() returns empty — the path field was cleared or never initialized (headless reuse of the component without setPath).
Common situations: User wipes the location field in New Project dialog; custom wizard step embedding NamePathComponent does not pre-set path from the previously chosen directory; drag-select accidentally deletes the path text.
Related errors
- Enter {0} file location
- Enter module file location
- Enter a file name to create a new {0} {1}
- {0} location path should be absolute
- Enter a file name to create a new {0} {1}
AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14).
Data as JSON: /api/errors/3e0da951799bae69.
Report an issue: GitHub.