{"record":{"id":"d6c72e0248bcab34","repo":"HMCL-dev/HMCL","slug":"processor-jar-cannot-be-null","errorCode":null,"errorMessage":"Processor::jar cannot be null","messagePattern":"Processor::jar cannot be null","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/download/forge/ForgeNewInstallProfile.java","lineNumber":195,"sourceCode":"            return args == null ? Collections.emptyList() : args;\n        }\n\n        /**\n         * File-checksum pairs, used for verifying the output file is correct.\n         * Arguments to pass to the processor jar.\n         * Keys can be in one of [artifact] or {entry}. Should be file path.\n         * Values can be in one of {entry} or 'literal'. Should be SHA-1 checksum.\n         * @return files output from this processor.\n         * @see ForgeNewInstallTask#parseLiteral(String, Map, ExceptionalFunction)\n         */\n        public Map<String, String> getOutputs() {\n            return outputs == null ? Collections.emptyMap() : outputs;\n        }\n\n        @Override\n        public void validate() throws JsonParseException, TolerableValidationException {\n            if (jar == null)\n                throw new JsonParseException(\"Processor::jar cannot be null\");\n        }\n    }\n\n    public static class Datum {\n        private final String client;\n\n        public Datum(String client) {\n            this.client = client;\n        }\n\n        /**\n         * Can be in the following formats:\n         * [value]: An artifact path.\n         * 'value': A string literal.\n         * value: A file in the installer package, to be extracted to a temp folder, and then have the absolute path in replacements.\n         * @return Value to use for the client install\n         */\n        public String getClient() {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/download/forge/ForgeNewInstallProfile.java#L177-L213","documentation":"The nested Processor.validate() throws JsonParseException when a processor entry in install_profile.json has no 'jar' field. Every Forge processor must name the JAR artifact containing its main class; without it HMCL cannot run the processor. Thrown during profile deserialization validation.","triggerScenarios":"Parsing an install_profile.json whose 'processors' array contains an entry missing the 'jar' key (or where Gson left it null), during ForgeNewInstallTask profile loading.","commonSituations":"Corrupted or hand-edited installer profiles; a Forge installer version whose processor schema HMCL does not fully understand; truncated installer downloads.","solutions":["Re-download the official Forge installer matching the desired game version","Inspect install_profile.json inside the installer and confirm every processors[] entry has a 'jar' field","Report the profile to HMCL if a legitimately new Forge format omits 'jar' (schema change needing launcher support)","Use a different Forge version whose installer profile is known to work with this HMCL version"],"exampleFix":"// before: hand-edited profile processor entry\n{\"channels\": [\"extract\"], \"outputs\": {...}}\n// after\n{\"jar\": \"net.minecraftforge:installertools:1.3.0\", \"classpath\": [...], \"args\": [...], \"outputs\": {...}}","handlingStrategy":"validation","validationCode":"// Validate processors before installation\ntry (FileSystem fs = CompressingUtils.createReadOnlyZipFileSystem(installer)) {\n    JsonObject profile = JsonParser.parseString(Files.readString(fs.getPath(\"install_profile.json\"))).getAsJsonObject();\n    JsonArray processors = profile.getAsJsonArray(\"processors\");\n    for (JsonElement p : processors)\n        if (p.getAsJsonObject().get(\"jar\") == null) throw new IOException(\"Processor without jar in profile\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    task.run();\n} catch (JsonParseException e) {\n    // treat installer as corrupt: re-download and retry once\n}","preventionTips":["Do not hand-edit install_profile.json inside installer JARs","Re-download installer on any JsonParseException during install","Prefer official installer artifacts over repacked ones"],"tags":["forge","json-validation","processor"],"backgroundTag":"missing-required-config-field","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}