{"record":{"id":"a9909ac4abdc2727","repo":"JetBrains/intellij-community","slug":"enter-a-file-name-to-create-a-new-0-1-a9909a","errorCode":null,"errorMessage":"Enter a file name to create a new {0} {1}","messagePattern":"Enter a file name to create a new (.+?) (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectNameStep.java","lineNumber":107,"sourceCode":"  }\n\n  @Override\n  public void updateDataModel() {\n    myWizardContext.setProjectName(getProjectName());\n    myWizardContext.setProjectFileDirectory(getProjectFileDirectory());\n  }\n\n  @Override\n  public Icon getIcon() {\n    return myWizardContext.getStepIcon();\n  }\n\n  @Override\n  public boolean validate() throws ConfigurationException {\n    String name = myNamePathComponent.getNameValue();\n    if (name.isEmpty()) {\n      ApplicationNamesInfo info = ApplicationNamesInfo.getInstance();\n      throw new ConfigurationException(JavaUiBundle.message(\"prompt.new.project.file.name\", info.getFullProductName(), myWizardContext.getPresentationName()));\n    }\n\n    final String projectFileDirectory = getProjectFileDirectory();\n    if (projectFileDirectory.isEmpty()) {\n      throw new ConfigurationException(JavaUiBundle.message(\"prompt.enter.project.file.location\", myWizardContext.getPresentationName()));\n    }\n\n    final boolean shouldPromptCreation = myNamePathComponent.isPathChangedByUser();\n    String prefix = JavaUiBundle.message(\"directory.project.file.directory\", myWizardContext.getPresentationName());\n    if (!ProjectWizardUtil.createDirectoryIfNotExists(prefix, projectFileDirectory, shouldPromptCreation)) {\n      return false;\n    }\n\n    boolean shouldContinue = true;\n\n    final String path = myWizardContext.isCreatingNewProject() && myWizardContext.getProjectStorageFormat() == DIRECTORY_BASED\n                        ? getProjectFileDirectory() + \"/\" + Project.DIRECTORY_STORE_FOLDER : getProjectFilePath();\n    final File projectFile = new File(path);","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectNameStep.java#L89-L125","documentation":"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.","triggerScenarios":"Wizard reaches ProjectNameStep.validate() while myNamePathComponent.getNameValue() returns the empty string (name field cleared or never pre-filled).","commonSituations":"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.","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"],"exampleFix":"// before\nWizardContext ctx = new WizardContext(null, new WizardStartupSettings(...));\nnew ProjectNameStep(ctx).validate(); // ConfigurationException: enter a file name\n\n// after\nctx.setProjectName(\"my-app\");\nnew ProjectNameStep(ctx).validate();","handlingStrategy":"validation","validationCode":"if (step.getNamePathComponent().getNameValue().isEmpty()) {\n  wizardContext.setProjectName(\"untitled\"); // or block Next\n}\nstep.validate();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set a default project name on the WizardContext before showing ProjectNameStep","Bind Finish enablement to name-field emptiness"],"tags":["wizard","project","validation","intellij"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}