oracle/graal · error · IllegalArgumentException

--java.LivenessAnalysis can only be 'none'|'false', 'auto' o

Error message

--java.LivenessAnalysis can only be 'none'|'false', 'auto' or 'all'|'true'.

What it means

The converter for --java.LivenessAnalysis accepts 'true'/'false' as legacy boolean aliases (mapped to ALL/NONE) plus the enum names NONE/AUTO/ALL, case-insensitively. Any other string throws IllegalArgumentException from the option parser.

Source

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

        NONE,
        ALL,
        AUTO // Activate liveness analysis for certain methods.
    }

    private static final OptionType<LivenessAnalysisMode> LIVENESS_ANALYSIS_MODE_OPTION_TYPE = new OptionType<>("LivenessAnalysisMode", new Function<String, LivenessAnalysisMode>() {
        @Override
        public LivenessAnalysisMode apply(String s) {
            // To maintain backwards compatibility with the boolean option.
            if ("true".equalsIgnoreCase(s)) {
                return LivenessAnalysisMode.ALL;
            }
            if ("false".equalsIgnoreCase(s)) {
                return LivenessAnalysisMode.NONE;
            }
            try {
                return LivenessAnalysisMode.valueOf(s.toUpperCase(Locale.ROOT));
            } catch (IllegalArgumentException e) {
                throw new IllegalArgumentException("--java.LivenessAnalysis can only be 'none'|'false', 'auto' or 'all'|'true'.");
            }
        }
    });

    @Option(help = "Controls static liveness analysis of bytecodes, allowing to clear local variables during execution if they become stale.\\n" + //
                    "Liveness analysis, if enabled, only affects compiled code.", //
                    category = OptionCategory.EXPERT, //
                    stability = OptionStability.STABLE, //
                    usageSyntax = "auto|true|all|false|none") //
    public static final OptionKey<LivenessAnalysisMode> LivenessAnalysis = new OptionKey<>(LivenessAnalysisMode.AUTO, LIVENESS_ANALYSIS_MODE_OPTION_TYPE);

    @Option(help = "Minimum number of locals to run liveness analysis.\\n" + //
                    "Liveness analysis, if enabled, only affects compiled code.", //
                    category = OptionCategory.EXPERT, //
                    stability = OptionStability.EXPERIMENTAL, //
                    usageSyntax = "[0, 65535]") //
    public static final OptionKey<Integer> LivenessAnalysisMinimumLocals = new OptionKey<>(8);

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Use --java.LivenessAnalysis=auto (default), all|true, or none|false.
  2. If your config was written for the old boolean option, map true->all and false->none (though the legacy spellings still work).
  3. Check for empty values caused by unset environment variables in launch scripts.

Example fix

# before
--java.LivenessAnalysis=on

# after
--java.LivenessAnalysis=all
Defensive patterns

Strategy: validation

Validate before calling

if (!List.of("none","false","auto","all","true").contains(s.toLowerCase(Locale.ROOT))) {
    throw new ConfigException("LivenessAnalysis must be none|false|auto|all|true");
}

Type guard

static boolean validLiveness(String s) {
    return s != null && s.matches("(?i)(none|false|auto|all|true)");
}

Prevention

When it happens

Trigger: Passing --java.LivenessAnalysis=<value> where value is not none/false, auto, or all/true (e.g. 'on', 'off', 'minimal', or a numeric value).

Common situations: Configs migrated between GraalVM versions where the option changed from boolean to enum; guessing values from the help text incorrectly; YAML/env-var templating that substitutes empty strings.

Related errors


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