oracle/graal · error · GraalError

Could not run command: %s

Error message

Could not run command: %s

What it means

Error "Could not run command: %s" thrown in oracle/graal.

Source

Thrown at compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/GetJNIConfig.java:94

     */
    private Path configFilePath;

    int lineNo;

    private GetJNIConfig(ClassLoader loader, Path libgraalJavaHome) {
        this.loader = loader;
        Path javaExe = getJavaExe(libgraalJavaHome);
        configFilePath = Path.of("libgraal_jniconfig.txt");

        String[] command = {javaExe.toFile().getAbsolutePath(), "-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCI", "-XX:JVMCILibDumpJNIConfig=" + configFilePath};
        quotedCommand = Stream.of(command).map(e -> e.indexOf(' ') == -1 ? e : '\'' + e + '\'').collect(Collectors.joining(" "));
        ProcessBuilder pb = new ProcessBuilder(command);
        pb.redirectErrorStream(true);
        Process p;
        try {
            p = pb.start();
        } catch (IOException e) {
            throw new GraalError(e, "Could not run command: %s", quotedCommand);
        }

        String nl = System.lineSeparator();
        String out = new BufferedReader(new InputStreamReader(p.getInputStream())).lines().collect(Collectors.joining(nl));

        int exitValue;
        try {
            exitValue = p.waitFor();
        } catch (InterruptedException e) {
            throw new GraalError(e, "Interrupted waiting for command: %s%n%s", quotedCommand, out);
        }
        if (exitValue != 0) {
            throw new GraalError("Command finished with exit value %d: %s%n%s", exitValue, quotedCommand, out);
        }
        try {
            lines = Files.readAllLines(configFilePath);
        } catch (IOException e) {
            Path cfp = configFilePath;

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Fix the condition reported by the error: Could not run command: {}
  2. Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call.

Example fix

Validate inputs and environment so that the failing condition does not occur: Could not run command: {}

When it happens

Trigger: Thrown at compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/GetJNIConfig.java:94 when the library encounters an invalid state.

Common situations: Occurs when a caller violates the contract guarded by this check: Could not run command: {}


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