JetBrains/intellij-community · error · ConfigurationException
Enter module file location
Error message
Enter module file location
What it means
Thrown by ModuleNameLocationComponent.validateModulePaths() when the module file location (the .iml directory) text field is empty. The wizard cannot decide where to place the module file, so validation stops with a prompt to enter the location.
Source
Thrown at java/idea-ui/src/com/intellij/ide/projectWizard/ModuleNameLocationComponent.java:355
fromConfigurable != null ? fromConfigurable.getContext().getModulesConfigurator().getModuleModel()
: null;
if (modifiableModel != null) {
module = modifiableModel.findModuleByName(moduleName);
}
else {
module = ModuleManager.getInstance(project).findModuleByName(moduleName);
}
if (module != null) {
throw new ConfigurationException(
JavaUiBundle.message("module.name.location.dialog.message.module.already.exist.in.project", moduleName));
}
}
private boolean validateModulePaths() throws ConfigurationException {
String moduleName = getModuleName();
String moduleFileDirectory = myModuleFileLocation.getText();
if (moduleFileDirectory.isEmpty()) {
throw new ConfigurationException(JavaUiBundle.message("module.name.location.dialog.message.enter.module.file.location"));
}
if (moduleName.isEmpty()) {
throw new ConfigurationException(JavaUiBundle.message("module.name.location.dialog.message.enter.module.name"));
}
if (!ProjectWizardUtil.createDirectoryIfNotExists(JavaUiBundle.message("directory.module.file"), moduleFileDirectory,
myImlLocationChangedByUser)) {
return false;
}
if (!ProjectWizardUtil.createDirectoryIfNotExists(JavaUiBundle.message("directory.module.content.root"), myModuleContentRoot.getText(),
myContentRootChangedByUser)) {
return false;
}
File moduleFile = new File(moduleFileDirectory, moduleName + ModuleFileType.DOT_DEFAULT_EXTENSION);
if (moduleFile.exists()) {
int answer = MessageDialogBuilder.yesNo(IdeBundle.message("title.file.already.exists"),
CoreBundle.message("prompt.overwrite.project.file", moduleFile.getAbsolutePath(),View on GitHub (pinned to be881553f2)
Solutions
- Fill in the module file location field with the directory where the .iml should live
- If the field is unexpectedly blank, close and reopen the wizard so defaults are recomputed
- In plugin code, always seed the component: component.setModuleFilePath(baseDir + "/" + name + "/" + name + ".iml") before validate()
Example fix
// before
component.setModuleName("my-module");
// module file location field left empty
component.validate(); // ConfigurationException: Enter module file location
// after
component.setModuleName("my-module");
component.setModuleFilePath(projectPath + "/my-module/my-module.iml");
component.validate(); Defensive patterns
Strategy: validation
Validate before calling
if (component.getModuleFileLocation() == null || component.getModuleFileLocation().getText().isEmpty()) {
// prefill with project base dir + module name, then validate
} Prevention
- When embedding ModuleNameLocationComponent, always seed the file-location field from the wizard base dir
- Enable the Finish button only when both name and location fields are non-empty
When it happens
Trigger: Calling validate()/validateModulePaths() while myModuleFileLocation.getText() returns the empty string — the user cleared the path field or the field was never pre-populated (e.g. headless use of the component without prior fill).
Common situations: User accidentally deletes the pre-filled module path in the New Module wizard; plugin reuses ModuleNameLocationComponent programmatically and forgets to call setModuleFileLocation; UI focus jumps straight to Finish.
Related errors
- Enter a module name
- Enter {0} file location
- Enter {0} file location
- Module '{0}' already exist in project. Please, specify anoth
- 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/b00f55b373e93d4c.
Report an issue: GitHub.