projectlombok/lombok · error · InvalidCommandLineException

mandatory argument ' ' missing

Error message

mandatory argument '<key>' missing

What it means

CreateEclipseDebugTarget.getArgString requires a value for mandatory command-line keys; a null lookup means the key wasn't supplied, so it throws InvalidCommandLineException "mandatory argument '<key>' missing". Called by n, type and jvmTarget parsing.

Solutions

  1. Add the missing argument named in the message to the command line
  2. Check spelling/casing of the argument key
  3. Consult the tool's main/usage to list required keys
  4. Wrap invocation in a script that supplies defaults for required keys

Example fix

// before
java ... type=
// after
java ... type=java jvmTarget=17
Defensive patterns

Strategy: validation

Validate before calling

Set<String> required = Set.of("type", "jvmTarget", /* key for name */);
for (String k : required) if (!argsMap.containsKey(k)) throw new IllegalArgumentException("missing arg: " + k);

Try / catch

try { tool.main(argv); } catch (InvalidCommandLineException e) { if (e.getMessage().contains("mandatory argument")) { printUsage(e.getMessage()); } throw e; }

Prevention

When it happens

Trigger: Running the tool without a required argument such as type, jvmTarget, or the one used to compute the project name n; the args map has no entry for that key.

Common situations: Incomplete command line copied from docs, dropped argument in a script, misspelled argument name (keys are case-sensitive).

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of projectlombok/lombok@6d6a3e9fec (2026-09-07). Data as JSON: /api/errors/a1acd988911d22f0. Report an issue: GitHub.

Appendix: source

Thrown at src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java:156

			if (bootpath != null) launchContent.append(" -Ddelombok.bootclasspath=" + bootpath);
		}
		launchContent.append("\"/>\n</launchConfiguration>\n");
	}
	
	private String getBootPath() {
		String bp = args.get("bootpath");
		if (bp == null || bp.isEmpty() || bp.equals("0")) return null;
		File f = new File(bp);
		if (!f.isAbsolute()) return bp;
		String r = new File(".").getAbsolutePath();
		if (r.endsWith(".")) r = r.substring(0, r.length() - 1);
		if (bp.startsWith(r)) return bp.substring(r.length());
		throw new IllegalStateException("Cannot reconstruct relative path; base: " + r + " is not a parent of " + bp);
	}
	
	private String getArgString(String key) throws InvalidCommandLineException {
		String v = args.get(key);
		if (v == null) throw new InvalidCommandLineException("mandatory argument '" + key + "' missing");
		return v;
	}
	
	private boolean getArgBoolean(String key) throws InvalidCommandLineException {
		String v = args.get(key);
		if (v == null) return false;
		if (v.equalsIgnoreCase("false") || v.equalsIgnoreCase("f")) return false;
		return true;
	}
	
	private static void printCommandLineHelp() {
		System.err.println("CreateEclipseDebugTarget\n" +
			"   name=Lombok-test BaseJavac 11           # Sets the name of the debug target to make\n" +
			"   testType=lombok.RunJavacAndBaseTests    # The test class file that this debug target should run\n" +
			"   shadowLoaderBased                       # Add the VM options to use lombok as an agent and pass the classpath to the shadow loader. Needed for ECJ/Eclipse.\n" +
			"   conf.test=foo:bar:baz                   # Where 'test' is an ivy conf name, and 'foo' is a path to a jar, relativized vs. current directory.\n" +
			"   favorite                                # Should the debug target be marked as favourite?\n" +
			"");

View on GitHub (pinned to 6d6a3e9fec)