{"record":{"id":"cdfcb7c3ee234342","repo":"oracle/graal","slug":"error-running-command-s","errorCode":null,"errorMessage":"Error running command: %s","messagePattern":"Error running command: (.+?)","errorType":"panic","errorClass":"GraalError","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/GetCompilerConfig.java","lineNumber":93,"sourceCode":"        String search = \"jrt:/\" + module;\n        String[] command = {javaExe.toString(), \"--show-module-resolution\", \"--version\"};\n        try {\n            Process p = new ProcessBuilder(command).start();\n            BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));\n            String line;\n            boolean found = false;\n            while ((line = reader.readLine()) != null) {\n                if (line.contains(search)) {\n                    found = true;\n                }\n            }\n            int exitValue = p.waitFor();\n            if (exitValue != 0) {\n                throw new GraalError(\"Command finished with exit value %d: %s\", exitValue, String.join(\" \", command));\n            }\n            return found;\n        } catch (Exception e) {\n            throw new GraalError(e, \"Error running command: %s\", String.join(\" \", command));\n        }\n    }\n\n    /**\n     * Launches the JVM in {@code javaHome} to run {@link CompilerConfig}.\n     *\n     * @param javaHome the value of the {@code java.home} system property reported by a Java\n     *            installation directory that includes the Graal classes in its runtime image\n     */\n    public static Result from(Path javaHome) {\n        Path javaExe = GetJNIConfig.getJavaExe(javaHome);\n        Map<String, Set<String>> opens = CollectionsUtil.mapOf(\n                        // Needed to reflect fields like\n                        // java.util.ImmutableCollections.EMPTY\n                        \"java.base\", CollectionsUtil.setOf(\"java.util\"));\n\n        // Only modules in the boot layer can be the target of --add-exports\n        String addExports = \"--add-exports=java.base/jdk.internal.misc=jdk.graal.compiler\";","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/GetCompilerConfig.java#L75-L111","documentation":"Error \"Error running command: %s\" thrown in oracle/graal.","triggerScenarios":"Thrown at compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/GetCompilerConfig.java:93 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Error running command: {}","solutions":["Fix the condition reported by the error: Error running command: {}","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Error running command: {}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}