{"record":{"id":"ea57cb2a9fcd06f2","repo":"JetBrains/intellij-community","slug":"0-location-path-should-be-absolute","errorCode":null,"errorMessage":"{0} location path should be absolute","messagePattern":"(.+?) location path should be absolute","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"java/idea-ui/src/com/intellij/ide/util/projectWizard/NamePathComponent.java","lineNumber":160,"sourceCode":"    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()));\n      }\n    }\n    if (projectDirectory.exists() && !projectDirectory.isDirectory()) {","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/idea-ui/src/com/intellij/ide/util/projectWizard/NamePathComponent.java#L142-L178","documentation":"Thrown by NamePathComponent.validateNameAndPath() when the entered path is relative and the component requires absolute paths (myShouldBeAbsolute is true). Wizard-created projects must live at an unambiguous absolute location because the IDE stores and switches to it verbatim.","triggerScenarios":"Calling validateNameAndPath() with getPath() returning something like 'mydir/proj' while myShouldBeAbsolute was enabled (default for this component); new File(path).isAbsolute() returns false on Unix for paths without a leading '/', or on Windows without a drive letter.","commonSituations":"User types a relative path such as '~/projects/x' that the field does not expand, or plain 'demo'; path variable/macro was not substituted; copy-paste from a shell-relative context.","solutions":["Enter a fully qualified absolute path (e.g. /home/user/IdeaProjects/demo or C:\\\\work\\\\demo)","Use the browse (...) button to pick the directory — it inserts an absolute path","Replace '~' with the actual home directory path","In plugin code, absolutize first: Path.of(baseDir, relative).toAbsolutePath().toString()"],"exampleFix":"// before\ncomponent.setPath(\"demo/app\"); // relative\ncomponent.validateNameAndPath(context, true); // ConfigurationException: path should be absolute\n\n// after\ncomponent.setPath(Path.of(\"/home/user/IdeaProjects/demo/app\").toAbsolutePath().toString());\ncomponent.validateNameAndPath(context, true);","handlingStrategy":"validation","validationCode":"String path = component.getPath();\nif (path != null && !new File(path).isAbsolute()) {\n  component.setPath(Path.of(baseDir, path).toAbsolutePath().toString());\n}\ncomponent.validateNameAndPath(context, true);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Absolutize user input against the current base dir before validation","Expand '~' and path variables yourself; do not rely on the field to do it"],"tags":["wizard","project","path","absolute-path","intellij"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}