projectlombok/lombok · error · InvalidCommandLineException
Cannot obtain canonical path to parent directory
Error message
Cannot obtain canonical path to parent directory
What it means
CreateEclipseDebugTarget builds an Eclipse launch configuration file and needs the canonical path of the parent directory ('..'). If File.getCanonicalPath() throws IOException, it throws InvalidCommandLineException with this message.
Solutions
- Run the tool from an existing, valid working directory
- Check that the parent directory exists and is readable
- Inspect the wrapped IOException cause for the real reason
- Avoid symlinked or network mounts if canonicalization keeps failing
Defensive patterns
Strategy: validation
Validate before calling
File parent = new File("..");
if (!parent.exists()) throw new IllegalStateException("cwd/parent missing; cd to a valid directory first"); Try / catch
try { tool.go(); } catch (InvalidCommandLineException e) { if (e.getMessage().contains("canonical path")) { log("Run from a valid, existing directory"); } throw e; } Prevention
- Launch the tool from an existing project directory
- Avoid running from deleted or network-mounted paths
- Check cwd validity in wrapper scripts before invoking
- If canonicalization keeps failing, log cwd and inspect the wrapped IOException cause
When it happens
Trigger: Running the lombok eclipse debug-target creation tool from a directory whose '..' cannot be resolved canonically (deleted cwd, IO failure resolving symlinks).
Common situations: Invoking the tool from a removed working directory, unusual mounts, or permission-restricted filesystems.
Related errors
- Cannot obtain canonical path to dependency
- I/O problem during delombok
- ${element} ${message}
- mandatory argument ' ' missing
- I/O exception uploading
AI-assisted analysis of projectlombok/lombok@6d6a3e9fec (2026-09-07).
Data as JSON: /api/errors/cca29248e058faf2.
Report an issue: GitHub.
Appendix: source
Thrown at src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java:93
launchContent.append("\t<listAttribute key=\"org.eclipse.debug.ui.favoriteGroups\">\n");
launchContent.append("\t\t<listEntry value=\"org.eclipse.debug.ui.launchGroup.debug\"/>\n");
launchContent.append("\t</listAttribute>\n");
}
launchContent.append("\t<stringAttribute key=\"org.eclipse.jdt.junit.CONTAINER\" value=\"\"/>\n");
launchContent.append("\t<booleanAttribute key=\"org.eclipse.jdt.junit.KEEPRUNNING_ATTR\" value=\"false\"/>\n");
launchContent.append("\t<stringAttribute key=\"org.eclipse.jdt.junit.TESTNAME\" value=\"\"/>\n");
launchContent.append("\t<stringAttribute key=\"org.eclipse.jdt.junit.TEST_KIND\" value=\"org.eclipse.jdt.junit.loader.junit4\"/>\n");
launchContent.append("\t<booleanAttribute key=\"org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD\" value=\"true\"/>\n");
}
private void classpath() throws InvalidCommandLineException {
launchContent.append("\t<listAttribute key=\"org.eclipse.jdt.launching.CLASSPATH\">\n");
String self; try {
self = new File("..").getCanonicalPath();
} catch (IOException e) {
throw new InvalidCommandLineException("Cannot obtain canonical path to parent directory", e);
}
String bootpath = getBootPath();
launchContent.append("\t\t<listEntry value=\"<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/lombok/bin/main" path="3" type="2"/> \"/>\n");
for (Map.Entry<String, String> entry : args.entrySet()) {
if (!entry.getKey().startsWith("conf.")) continue;
String v = entry.getValue();
if (v.equals("NONE")) continue;
String[] files = v.split(Pattern.quote(File.pathSeparator));
for (String file : files) {
String n;
try {
n = new File(file).getCanonicalPath();
} catch (IOException e) {
throw new InvalidCommandLineException("Cannot obtain canonical path to dependency " + file, e);
}
if (n.startsWith(self)) {View on GitHub (pinned to 6d6a3e9fec)