{"record":{"id":"3e0da951799bae69","repo":"JetBrains/intellij-community","slug":"enter-0-file-location","errorCode":null,"errorMessage":"Enter {0} file location","messagePattern":"Enter (.+?) file location","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"java/idea-ui/src/com/intellij/ide/util/projectWizard/NamePathComponent.java","lineNumber":157,"sourceCode":"    String baseDir = context.getProjectFileDirectory();\n    String projectName = context.getProjectName();\n    String initialProjectName = projectName != null ? projectName : ProjectWizardUtil.findNonExistingFileName(baseDir, \"untitled\", \"\");\n    component.setPath(projectName == null ? (baseDir + File.separator + initialProjectName) : baseDir);\n    component.setNameValue(initialProjectName);\n    component.getNameComponent().select(0, initialProjectName.length());\n    return component;\n  }\n\n  public boolean validateNameAndPath(WizardContext context, boolean defaultFormat) throws ConfigurationException {\n    String name = getNameValue();\n    if (StringUtil.isEmptyOrSpaces(name)) {\n      ApplicationNamesInfo info = ApplicationNamesInfo.getInstance();\n      throw new ConfigurationException(JavaUiBundle.message(\"prompt.new.project.file.name\", info.getFullProductName(), context.getPresentationName()));\n    }\n\n    String projectDirectoryPath = getPath();\n    if (StringUtil.isEmptyOrSpaces(projectDirectoryPath)) {\n      throw new ConfigurationException(JavaUiBundle.message(\"prompt.enter.project.file.location\", context.getPresentationName()));\n    }\n    if (myShouldBeAbsolute && !new File(projectDirectoryPath).isAbsolute()) {\n      throw new ConfigurationException(JavaUiBundle.message(\"file.location.should.be.absolute\", StringUtil.capitalize(context.getPresentationName())));\n    }\n\n    boolean shouldPromptCreation = isPathChangedByUser();\n    String message = JavaUiBundle.message(\"directory.project.file.directory\", context.getPresentationName());\n    if (!ProjectWizardUtil.createDirectoryIfNotExists(message, projectDirectoryPath, shouldPromptCreation)) {\n      return false;\n    }\n\n    File projectDirectory = new File(projectDirectoryPath);\n    if (projectDirectory.exists() && !projectDirectory.canWrite()) {\n      throw new ConfigurationException(JavaUiBundle.message(\"project.directory.is.not.writable\", projectDirectoryPath));\n    }\n    for (Project p : ProjectManager.getInstance().getOpenProjects()) {\n      if (ProjectUtil.isSameProject(projectDirectory.toPath(), p)) {\n        throw new ConfigurationException(JavaUiBundle.message(\"project.directory.is.already.taken\", projectDirectoryPath, p.getName()));","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/idea-ui/src/com/intellij/ide/util/projectWizard/NamePathComponent.java#L139-L175","documentation":"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.","triggerScenarios":"Calling validateNameAndPath(context, defaultFormat) while getPath() returns empty — the path field was cleared or never initialized (headless reuse of the component without setPath).","commonSituations":"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.","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()"],"exampleFix":"// before\ncomponent.setNameValue(\"my-app\");\n// path field empty\ncomponent.validateNameAndPath(context, true); // ConfigurationException: enter file location\n\n// after\ncomponent.setNameValue(\"my-app\");\ncomponent.setPath(\"/home/user/IdeaProjects/my-app\");\ncomponent.validateNameAndPath(context, true);","handlingStrategy":"validation","validationCode":"if (component.getPath() == null || component.getPath().trim().isEmpty()) {\n  component.setPath(baseDir + File.separator + suggestedName);\n}\ncomponent.validateNameAndPath(context, true);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["wizard","project","path","validation","intellij"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}