oracle/graal · warning · InvalidArgumentException
no value provided
Error message
no value provided
What it means
InvalidArgumentException from BooleanValue.parseValue: parseValue was called with a null argument, meaning a boolean command-line option was declared/required but no value string was supplied at parse time. The option framework distinguishes 'missing value' (null) from 'unparseable value' (the sibling 'invalid boolean value' error).
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/util/args/BooleanValue.java:45
import java.util.Locale;
/**
* Parses a literal boolean ("true" or "false", ignoring case) from command line arguments.
*/
public class BooleanValue extends OptionValue<Boolean> {
public BooleanValue(String name, String help) {
super(name, help);
}
public BooleanValue(String name, boolean defaultValue, String help) {
super(name, defaultValue, help);
}
@Override
public boolean parseValue(String arg) throws InvalidArgumentException {
if (arg == null) {
throw new InvalidArgumentException(getName(), "no value provided");
}
switch (arg.toLowerCase(Locale.US)) {
case "true":
value = true;
break;
case "false":
value = false;
break;
default:
throw new InvalidArgumentException(getName(), String.format("invalid boolean value: \"%s\"", arg));
}
return true;
}
}
View on GitHub (pinned to a66e9ccd1d)
Solutions
- Supply an explicit value: '-optionName=true' or 'optionName true' depending on the parser's convention.
- If the option should be a pure flag, use an option type that treats bare presence as true (a Variant/flag style) instead of BooleanValue.
- Catch InvalidArgumentException at the CLI boundary and print the option's help text (getName() identifies which option failed).
Example fix
# before $ tool --verbose # BooleanValue gets null # after $ tool --verbose=true
Defensive patterns
Strategy: validation
Validate before calling
// Normalize CLI tokens before handing them to the parser
static String ensureBoolValue(String name, String raw) {
return (raw == null) ? "true" : raw; // or reject explicitly:
// if (raw == null) throw new InvalidArgumentException(name, "expects =true|=false");
} Try / catch
try {
cmd.parse(args);
} catch (InvalidArgumentException e) {
if ("no value provided".equals(e.getMessage())) {
printUsage(e.getOption()); // tell user to pass =true/=false
} else throw e;
} Prevention
- Always write boolean options in '=true'/'=false' form in scripts.
- Give BooleanValue a default at construction so omission is legal.
- Print option help text whenever InvalidArgumentException reaches the CLI boundary.
When it happens
Trigger: A Command/OptionValue-based CLI parses args where a boolean option name appears at the end of the argument list (or its '=' form has no right-hand side), so the framework passes null into BooleanValue.parseValue.
Common situations: Users writing './tool -verbose' (flag style) when the parser expects '-verbose=true'; trailing option name after a shell line-continuation mistake; programmatic arg-array construction that drops the value element.
Related errors
- invalid boolean value: "%s"
- no subcommand named '%s'
- no value provided
- invalid double value: "%s"
- no value provided
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/31ff003fcb98598a.
Report an issue: GitHub.