oracle/graal · error · IllegalArgumentException

Could not read directed inlining rules file: {path}

Error message

Could not read directed inlining rules file: {path}

What it means

After resolving the rules file path, DirectedInliningRules.parseCommandFile reads it with Files.readAllLines (DirectedInliningRules.java:229). Any IOException (missing file, permission denied, directory, unreadable NFS mount) is rethrown as IllegalArgumentException naming the file.

Source

Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/inlining/DirectedInliningRules.java:229

            }
        }
    }

    private static void parseCommandFile(String commandFileOptionValue, ArrayList<Rule> inlineRules, ArrayList<Rule> dontInlineRules) {
        if (commandFileOptionValue == null || commandFileOptionValue.trim().isEmpty()) {
            return;
        }
        Path commandFile;
        try {
            commandFile = Path.of(commandFileOptionValue.trim());
        } catch (InvalidPathException e) {
            throw new IllegalArgumentException("Invalid directed inlining rules file path: " + commandFileOptionValue, e);
        }
        List<String> lines;
        try {
            lines = Files.readAllLines(commandFile, StandardCharsets.UTF_8);
        } catch (IOException e) {
            throw new IllegalArgumentException("Could not read directed inlining rules file: " + commandFile, e);
        }
        for (int i = 0; i < lines.size(); i++) {
            parseCommandFileLine(commandFile, i + 1, lines.get(i), inlineRules, dontInlineRules);
        }
    }

    private static void parseCommandFileLine(Path commandFile, int lineNumber, String line, ArrayList<Rule> inlineRules, ArrayList<Rule> dontInlineRules) {
        String commandLine = stripComment(line).trim();
        if (commandLine.isEmpty()) {
            return;
        }
        int commandSeparator = findCommandSeparator(commandLine);
        if (commandSeparator < 0) {
            throw invalidCommand(commandFile, lineNumber, commandLine);
        }
        String command = commandLine.substring(0, commandSeparator).trim().toLowerCase(Locale.ROOT);
        String ruleSpec = commandLine.substring(commandSeparator + 1).trim();
        if (ruleSpec.startsWith(String.valueOf(DIRECTIVE_SEPARATOR))) {

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Verify the file exists and is readable by the JVM user: ls -l <path> and test -r <path>
  2. Use an absolute path so the JVM's working directory does not matter
  3. Check for typos and trailing whitespace/newline in the flag value

Example fix

# before
java -Dgraal.DirectedInliningCommandFile=inline-rules.txt App  # run from another dir

# after
java -Dgraal.DirectedInliningCommandFile=/abs/path/inline-rules.txt App
Defensive patterns

Strategy: validation

Validate before calling

Path p = Path.of(rulesPath).toAbsolutePath();
if (!Files.isRegularFile(p) || !Files.isReadable(p)) throw new IllegalArgumentException("rules file missing/unreadable: " + p);

Prevention

When it happens

Trigger: Setting -Dgraal.DirectedInliningCommandFile to a path that does not exist, is a directory, or is not readable by the JVM process.

Common situations: Running the VM from a different working directory than assumed; file permissions after a CI checkout; the path being valid for the shell but not for the daemon/service user running the JVM.

Related errors


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