oracle/graal · error · IllegalArgumentException

Option setting has does not match the pattern <name>=<value>

Error message

Option setting has does not match the pattern <name>=<value>: %s

What it means

Thrown by OptionsParser.parseOptionSettingTo when an option setting string does not contain an '=' character. GraalVM options are always passed as <name>=<value> pairs (e.g. in -Dgraal.* JVM flags or MX subprocess configuration), and this method is the central splitter for such strings. The message text itself contains a typo ('has does not match'), but the failure is simply a missing equals sign.

Source

Thrown at compiler/src/jdk.graal.compiler.options/src/jdk/graal/compiler/options/OptionsParser.java:135

     * @throws IllegalArgumentException if there's a problem parsing any of {@code options}
     */
    public static void parseOptions(String[] options, EconomicMap<OptionKey<?>, Object> values, Iterable<OptionDescriptors> loader) {
        EconomicMap<String, String> settings = EconomicMap.create();
        for (String option : options) {
            parseOptionSettingTo(option, settings);
        }
        parseOptions(settings, values, loader);
    }

    /**
     * Parses a given option setting string and adds the parsed key and value to {@code dst}.
     *
     * @param optionSetting a string matching the pattern {@code <name>=<value>}
     */
    public static void parseOptionSettingTo(String optionSetting, EconomicMap<String, String> dst) {
        int eqIndex = optionSetting.indexOf('=');
        if (eqIndex == -1) {
            throw new IllegalArgumentException("Option setting has does not match the pattern <name>=<value>: " + optionSetting);
        }
        dst.put(optionSetting.substring(0, eqIndex), optionSetting.substring(eqIndex + 1));
    }

    /**
     * Splits a list of option settings into an array of options. If {@code options} starts with a
     * non-letter character, that character is used as the delimiter between options. Otherwise,
     * whitespace is the delimiter.
     *
     * @param options string containing a separated list of option settings.
     * @return an array of strings containing the individual parsed options.
     * @throws IllegalArgumentException if a non-whitespace delimiter is used and the delimiter
     *             appears repeated contiguously in {@code options}.
     */
    public static String[] splitOptions(String options) {
        String sepRegex = "\\s+";
        String toParse = options;
        if (!options.isEmpty() && !Character.isLetter(options.charAt(0))) {

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Check the offending string shown in the message and add the missing '=' and value (e.g. 'PrintGraph' -> 'PrintGraph=false').
  2. If the string looks correct, print the exact list elements passed to parseOptions to find where quoting/concatenation dropped the '='.
  3. In shell scripts, quote the whole flag: -Dgraal."$OPT"="$VAL" rather than assembling it unquoted.
  4. Sanitize input lists before parsing: skip empty/blank elements and elements that are pure flags.

Example fix

// before
OptionsParser.parseOptionSettingTo("PrintGraph", values);

// after
OptionsParser.parseOptionSettingTo("PrintGraph=false", values);
Defensive patterns

Strategy: validation

Validate before calling

boolean isValidOptionSetting(String s) {
    return s != null && s.indexOf('=') > 0;
}

// before parsing
for (String setting : settingsList) {
    if (!isValidOptionSetting(setting)) {
        throw new IllegalArgumentException("Malformed option setting (expected <name>=<value>): '" + setting + "'");
    }
}
OptionsParser.parseOptions(settingsList, values, loader);

Try / catch

try {
    OptionsParser.parseOptionSettingTo(setting, dst);
} catch (IllegalArgumentException e) {
    if (e.getMessage() != null && e.getMessage().contains("<name>=<value>")) {
        throw new ConfigException("Option '" + setting + "' is missing '='; expected <name>=<value>", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling OptionsParser.parseOptionSettingTo("PrintGraph") or parseOptions/parseOptionSettings with a list where an element like "Dump" or "CompileThreshold" has no '='. Also triggered when a value itself contains no '=' but a quoting bug upstream dropped it (e.g. shell stripping, an empty value written as "Name=" is fine, "Name" alone is not).

Common situations: Passing -Dgraal.PrintGraph=false style flags manually with a typo; building option strings programmatically by concatenation and forgetting the '='; MX or CI scripts passing a bare option name; a trailing whitespace-only or flag-like token ('--foo') leaking into the options list.

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/dc94e9d5b45883ef. Report an issue: GitHub.