{"record":{"id":"88fe1536347c514a","repo":"projectlombok/lombok","slug":"cannot-obtain-canonical-path-to-dependency","errorCode":null,"errorMessage":"Cannot obtain canonical path to dependency ","messagePattern":"Cannot obtain canonical path to dependency ","errorType":"console","errorClass":"InvalidCommandLineException","httpStatus":null,"severity":"error","filePath":"src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java","lineNumber":109,"sourceCode":"\t\t\tself = new File(\"..\").getCanonicalPath();\n\t\t} catch (IOException e) {\n\t\t\tthrow new InvalidCommandLineException(\"Cannot obtain canonical path to parent directory\", e);\n\t\t}\n\t\t\n\t\tString bootpath = getBootPath();\n\t\t\n\t\tlaunchContent.append(\"\\t\\t<listEntry value=\\\"&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/lombok/bin/main&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;\\\"/>\\n\");\n\t\tfor (Map.Entry<String, String> entry : args.entrySet()) {\n\t\t\tif (!entry.getKey().startsWith(\"conf.\")) continue;\n\t\t\tString v = entry.getValue();\n\t\t\tif (v.equals(\"NONE\")) continue;\n\t\t\tString[] files = v.split(Pattern.quote(File.pathSeparator));\n\t\t\tfor (String file : files) {\n\t\t\t\tString n;\n\t\t\t\ttry {\n\t\t\t\t\tn = new File(file).getCanonicalPath();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tthrow new InvalidCommandLineException(\"Cannot obtain canonical path to dependency \" + file, e);\n\t\t\t\t}\n\t\t\t\tif (n.startsWith(self)) {\n\t\t\t\t\tlaunchContent.append(\"\\t\\t<listEntry value=\\\"&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;\");\n\t\t\t\t\tlaunchContent.append(n.substring(self.length()));\n\t\t\t\t\tlaunchContent.append(\"&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;\\\"/>\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (bootpath != null) launchContent.append(\"\\t\\t<listEntry value=\\\"&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/lombok/\" + bootpath + \"&quot; path=&quot;5&quot; type=&quot;2&quot;/&gt;&#10;\\\"/>\\n\");\n\t\tlaunchContent.append(\"\\t</listAttribute>\\n\");\n\t}\n\t\n\tprivate void epilogue() throws InvalidCommandLineException {\n\t\tString type = getArgString(\"testType\");\n\t\t\n\t\tlaunchContent.append(\"\\t<booleanAttribute key=\\\"org.eclipse.jdt.launching.DEFAULT_CLASSPATH\\\" value=\\\"false\\\"/>\\n\");\n\t\tString jvmTarget = getArgString(\"jvmTarget\");\n\t\tString bootpath = getBootPath();","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java#L91-L127","documentation":"Same tool as above: while converting each dependency path from the classpath into a canonical path to decide if it lives under the lombok tree, a failing getCanonicalPath() throws InvalidCommandLineException naming the offending dependency file.","triggerScenarios":"A dependency path listed in the '-cp'-derived argument doesn't exist, is unreadable, or canonicalization fails (broken symlink, removed file).","commonSituations":"Stale classpath entries pointing at deleted jars, broken symlinks in the local repo, running with a corrupted dependency list.","solutions":["Check the file named in the message exists and is readable","Remove stale entries from the classpath argument","Rebuild/refresh dependencies so jars referenced actually exist","Inspect the wrapped IOException cause for details"],"exampleFix":"// before\njava ... conf.cp=/old/path/lib.jar\n// after\njava ... conf.cp=/valid/path/lib.jar","handlingStrategy":"validation","validationCode":"for (String f : classpath.split(File.pathSeparator)) {\n  if (!new File(f).exists()) throw new IllegalStateException(\"classpath entry missing: \" + f);\n}","typeGuard":null,"tryCatchPattern":"try { tool.go(); } catch (InvalidCommandLineException e) { if (e.getMessage().startsWith(\"Cannot obtain canonical path to dependency\")) { fixStaleEntry(e.getMessage()); } throw e; }","preventionTips":["Prune stale jars from classpath arguments","Rebuild dependencies so referenced artifacts exist","Replace broken symlinks in the local repository"],"tags":["java","eclipse","classpath","io"],"backgroundTag":"file-not-found","analyzedSha":"6d6a3e9fec0a9555702561fbeb8eac836575116e","analyzedAt":"2026-09-07T23:18:01.841Z","contentChangedAt":"2026-09-07T23:18:01.841Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}