{"record":{"id":"2e0a831c2a5e75a5","repo":"HMCL-dev/HMCL","slug":"game-processor-exited-abnormally-with-code-exitc","errorCode":null,"errorMessage":"Game processor exited abnormally with code ${exitCode}","messagePattern":"Game processor exited abnormally with code (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/download/neoforge/NeoForgeOldInstallTask.java","lineNumber":153,"sourceCode":"            classpath.add(jar.toString());\n            command.add(String.join(File.pathSeparator, classpath));\n\n            command.add(mainClass);\n\n            List<String> args = new ArrayList<>(processor.getArgs().size());\n            for (String arg : processor.getArgs()) {\n                String parsed = parseLiteral(arg, vars);\n                if (parsed == null)\n                    throw new ArtifactMalformedException(\"Invalid forge installation configuration\");\n                args.add(parsed);\n            }\n\n            command.addAll(args);\n\n            LOG.info(\"Executing external processor \" + processor.getJar().toString() + \", command line: \" + new CommandBuilder().addAll(command).toString());\n            int exitCode = SystemUtils.callExternalProcess(command);\n            if (exitCode != 0)\n                throw new IOException(\"Game processor exited abnormally with code \" + exitCode);\n\n            for (Map.Entry<String, String> entry : outputs.entrySet()) {\n                Path artifact = Paths.get(entry.getKey());\n                if (!Files.isRegularFile(artifact))\n                    throw new FileNotFoundException(\"File missing: \" + artifact);\n\n                String code;\n                try (InputStream stream = Files.newInputStream(artifact)) {\n                    code = DigestUtils.digestToString(\"SHA-1\", stream);\n                }\n\n                if (!Objects.equals(code, entry.getValue())) {\n                    Files.delete(artifact);\n                    throw new ChecksumMismatchException(\"SHA-1\", entry.getValue(), code);\n                }\n            }\n        }\n    }","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/download/neoforge/NeoForgeOldInstallTask.java#L135-L171","documentation":"Thrown as IOException when the external NeoForge/Forge install processor (a Java main class spawned via SystemUtils.callExternalProcess) exits with a non-zero exit code. The processor itself failed — HMCL only reports the exit code; the real cause is in the processor's captured stdout/stderr.","triggerScenarios":"SystemUtils.callExternalProcess(command) returns exitCode != 0 after running `java -cp ... <mainClass> <parsed args>` for a processor, e.g. because the vanilla jar is invalid, mapped data is missing, disk is full, or the default Java runtime is broken.","commonSituations":"Corrupted Minecraft client jar; wrong/incompatible default Java version selected; out-of-memory or full disk during processing; antivirus blocking the spawned java process; installer version mismatched with the game version.","solutions":["Read the processor's stdout/stderr in the HMCL log to find the processor's own error","Switch the default Java runtime (try a Java 8 or the recommended version for that loader)","Verify/re-download the Minecraft client jar and installer","Free disk space and ensure the game directory is writable and not blocked by antivirus","Retry the installation from scratch in a clean directory"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-checks: valid client jar, adequate disk space, correct Java runtime\nif (!Files.isRegularFile(minecraftJar)) throw new IllegalStateException(\"client jar missing\");\nFiles.getUsableSpace(repoDir);","typeGuard":null,"tryCatchPattern":"try { task.run(); } catch (IOException e) { if (e.getMessage().startsWith(\"Game processor exited abnormally\")) { int code = parseExitCode(e.getMessage()); inspectProcessorLogAndRetry(code); } else throw e; }","preventionTips":["Select the correct Java runtime for the loader version","Keep the vanilla client jar intact and unmodified","Ensure free disk space and a writable game directory","Allow java.exe through antivirus/firewall"],"tags":["external-process","java","exit-code","installer"],"backgroundTag":"command-not-found","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}