{"record":{"id":"b00f55b373e93d4c","repo":"JetBrains/intellij-community","slug":"enter-module-file-location","errorCode":null,"errorMessage":"Enter module file location","messagePattern":"Enter module file location","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"java/idea-ui/src/com/intellij/ide/projectWizard/ModuleNameLocationComponent.java","lineNumber":355,"sourceCode":"      fromConfigurable != null ? fromConfigurable.getContext().getModulesConfigurator().getModuleModel()\n                               : null;\n    if (modifiableModel != null) {\n      module = modifiableModel.findModuleByName(moduleName);\n    }\n    else {\n      module = ModuleManager.getInstance(project).findModuleByName(moduleName);\n    }\n    if (module != null) {\n      throw new ConfigurationException(\n        JavaUiBundle.message(\"module.name.location.dialog.message.module.already.exist.in.project\", moduleName));\n    }\n  }\n\n  private boolean validateModulePaths() throws ConfigurationException {\n    String moduleName = getModuleName();\n    String moduleFileDirectory = myModuleFileLocation.getText();\n    if (moduleFileDirectory.isEmpty()) {\n      throw new ConfigurationException(JavaUiBundle.message(\"module.name.location.dialog.message.enter.module.file.location\"));\n    }\n    if (moduleName.isEmpty()) {\n      throw new ConfigurationException(JavaUiBundle.message(\"module.name.location.dialog.message.enter.module.name\"));\n    }\n\n    if (!ProjectWizardUtil.createDirectoryIfNotExists(JavaUiBundle.message(\"directory.module.file\"), moduleFileDirectory,\n                                                      myImlLocationChangedByUser)) {\n      return false;\n    }\n    if (!ProjectWizardUtil.createDirectoryIfNotExists(JavaUiBundle.message(\"directory.module.content.root\"), myModuleContentRoot.getText(),\n                                                      myContentRootChangedByUser)) {\n      return false;\n    }\n\n    File moduleFile = new File(moduleFileDirectory, moduleName + ModuleFileType.DOT_DEFAULT_EXTENSION);\n    if (moduleFile.exists()) {\n      int answer = MessageDialogBuilder.yesNo(IdeBundle.message(\"title.file.already.exists\"),\n                                              CoreBundle.message(\"prompt.overwrite.project.file\", moduleFile.getAbsolutePath(),","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/idea-ui/src/com/intellij/ide/projectWizard/ModuleNameLocationComponent.java#L337-L373","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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()"],"exampleFix":"// before\ncomponent.setModuleName(\"my-module\");\n// module file location field left empty\ncomponent.validate(); // ConfigurationException: Enter module file location\n\n// after\ncomponent.setModuleName(\"my-module\");\ncomponent.setModuleFilePath(projectPath + \"/my-module/my-module.iml\");\ncomponent.validate();","handlingStrategy":"validation","validationCode":"if (component.getModuleFileLocation() == null || component.getModuleFileLocation().getText().isEmpty()) {\n  // prefill with project base dir + module name, then validate\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["module","wizard","validation","path","intellij"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}