oracle/graal · error · IllegalArgumentException

-Xverify: Mode can be 'none', 'remote' or 'all'.

Error message

-Xverify: Mode can be 'none', 'remote' or 'all'.

What it means

The OptionType converter for -Xverify (java.Verify) maps the string to VerifyMode.NONE/REMOTE/ALL via valueOf and throws when parsing fails. This mirrors the HotSpot -Xverify flag controlling bytecode verification.

Source

Thrown at espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/EspressoOptions.java:309

    @Option(help = "Force mimicking of hotspot behavior on unrespected specs points", //
                    category = OptionCategory.EXPERT, //
                    stability = OptionStability.EXPERIMENTAL, //
                    usageSyntax = "hotspot|strict") //
    public static final OptionKey<SpecComplianceMode> SpecCompliance = new OptionKey<>(SpecComplianceMode.HOTSPOT, SPEC_COMPLIANCE_OPTION_TYPE);

    public enum VerifyMode {
        NONE,
        REMOTE, // Verifies all bytecodes not loaded by the bootstrap class loader.
        ALL
    }

    private static final OptionType<VerifyMode> VERIFY_MODE_OPTION_TYPE = new OptionType<>("VerifyMode", new Function<String, VerifyMode>() {
        @Override
        public VerifyMode apply(String s) {
            try {
                return VerifyMode.valueOf(s.toUpperCase(Locale.ROOT));
            } catch (IllegalArgumentException e) {
                throw new IllegalArgumentException("-Xverify: Mode can be 'none', 'remote' or 'all'.");
            }
        }
    });

    @Option(help = "Sets the mode of the bytecode verifier.", //
                    category = OptionCategory.EXPERT, //
                    stability = OptionStability.STABLE, //
                    usageSyntax = "remote|none|all" //
    ) //
    public static final OptionKey<VerifyMode> Verify = new OptionKey<>(VerifyMode.REMOTE, VERIFY_MODE_OPTION_TYPE);

    @Option(help = "Replace regular expression engine with a TRegex implementation.", //
                    category = OptionCategory.USER, //
                    stability = OptionStability.EXPERIMENTAL, //
                    usageSyntax = "true|false") //
    public static final OptionKey<Boolean> UseTRegex = new OptionKey<>(false);

    @Option(help = "Speculatively inline field accessors.", //

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Use one of the accepted values: -Xverify=remote (default), -Xverify=none, or -Xverify=all.
  2. Replace -Xverify:false with -Xverify:none.
  3. Strip standard HotSpot-only flags from scripts that launch Espresso.

Example fix

# before
java -Xverify:false ...

# after
java -Xverify=none ...
Defensive patterns

Strategy: validation

Validate before calling

if (!Set.of("none", "remote", "all").contains(verifyMode.toLowerCase(Locale.ROOT))) {
    throw new IllegalArgumentException("Xverify must be none|remote|all");
}

Type guard

static boolean validXverify(String s) {
    return s != null && s.matches("(?i)(none|remote|all)");
}

Prevention

When it happens

Trigger: Passing -Xverify (java.Verify context option) with a value other than none/remote/all, e.g. '-Xverify:false' or '-Xverify none' (space form handled elsewhere, so the colon form reaching the converter fails).

Common situations: Reusing standard JVM flags verbatim (-Xverify:false is very common in Maven/Gradle JVM startup args); tools that forward JAVA_TOOL_OPTIONS to Espresso.

Related errors


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