{"record":{"id":"348eccd7f8324826","repo":"HMCL-dev/HMCL","slug":"game-processor-exited-abnormally-with-code","errorCode":null,"errorMessage":"Game processor exited abnormally with code ","messagePattern":"Game processor exited abnormally with code ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/download/forge/ForgeNewInstallTask.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                    if (!ZlibUtils.IS_ZLIB_COMPATIBLE && FileUtils.getExtension(artifact).equals(\"jar\")) {\n                        // Forge/NeoForge generates JARs dynamically during installation.\n                        // When native compression libraries such as zlib-ng are in use,\n                        // the resulting JAR may be compressed differently, causing its\n                        // SHA-1 hash to differ from the expected value recorded in the\n                        // install profile. In this case, fall back to verifying that the","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/download/forge/ForgeNewInstallTask.java#L135-L171","documentation":"Thrown when the external Forge game processor JVM process terminates with a nonzero exit code. HMCL runs each processor as 'java -cp ... <mainClass> <args>' and requires a clean exit; any failure inside the processor (bad inputs, corrupt source jar, unsupported Java, OOM) surfaces here wrapped in IOException.","triggerScenarios":"SystemUtils.callExternalProcess(command) returns nonzero after executing a Forge processor — e.g. the processor crashed due to a corrupted minecraft jar, wrong Java version, missing native tools, or invalid token substitution in args.","commonSituations":"Corrupted vanilla client JAR input; running on a Java runtime too old/new for the processor; disk full so the processor cannot write outputs; antivirus blocking the spawned java process.","solutions":["Read the processor's stdout/stderr in HMCL logs to find the underlying processor failure","Re-download the vanilla Minecraft client JAR and the Forge installer to rule out corrupt inputs","Run with a compatible Java runtime (match the one the Forge version expects)","Check free disk space and antivirus logs, then retry the installation"],"exampleFix":"// before: default Java may be too old for Forge 1.17+ processors\nJavaRuntime.getDefault().getBinary()\n// after: ensure a suitable runtime is selected/configured\nJavaRuntime runtime = JavaRuntime.fromCurrentJavaVersion(...); // pick Java 8/11/16+ as required\ncommand.add(runtime.getBinary().toString());","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    installTask.run();\n} catch (IOException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Game processor exited abnormally with code\")) {\n        // read processor stderr from HMCL logs; fix inputs (client jar, Java version, disk) and retry\n    }\n}","preventionTips":["Keep the vanilla client JAR intact and verified before installing Forge","Match the Java runtime to what the Forge version's processors require","Ensure adequate free disk space and that antivirus does not block spawned java processes"],"tags":["forge","process-exit","processor"],"backgroundTag":"http-request-failed","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"}