{"record":{"id":"8653979ddcedd509","repo":"HMCL-dev/HMCL","slug":"minecraft-client-jar-not-found","errorCode":null,"errorMessage":"Minecraft client JAR not found: ","messagePattern":"Minecraft client JAR not found: ","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/download/forge/ForgeNewInstallTask.java","lineNumber":399,"sourceCode":"                    mappingsTask.setCacheRepository(dependencyManager.getCacheRepository());\n                    return mappingsTask;\n                });\n    }\n\n    private Task<?> createProcessorTask(Processor processor, Map<String, String> vars) {\n        Task<?> task = patchDownloadMojangMappingsTask(processor, vars);\n        if (task == null) {\n            task = new ProcessorTask(processor, vars);\n        }\n        task.onDone().register(\n                () -> updateProgress(processorDoneCount.incrementAndGet(), processors.size()));\n        return task;\n    }\n\n    @Override\n    public void execute() throws Exception {\n        if (!Files.isRegularFile(minecraftJar)) {\n            throw new FileNotFoundException(\"Minecraft client JAR not found: \" + minecraftJar);\n        }\n        tempDir = Files.createTempDirectory(\"forge_installer\");\n        // External processors must not receive the shared cache path.\n        Path isolatedMinecraftJar = tempDir.resolve(\"minecraft.jar\");\n        FileUtils.copyFile(minecraftJar, isolatedMinecraftJar);\n\n        Map<String, String> vars = new HashMap<>();\n\n        try (FileSystem fs = CompressingUtils.createReadOnlyZipFileSystem(installer)) {\n            for (Map.Entry<String, String> entry : profile.getData().entrySet()) {\n                String key = entry.getKey();\n                String value = entry.getValue();\n\n                vars.put(key, parseLiteral(value,\n                        Collections.emptyMap(),\n                        str -> {\n                            Path dest = Files.createTempFile(tempDir, null, null);\n                            FileUtils.copyFile(fs.getPath(str), dest);","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/download/forge/ForgeNewInstallTask.java#L381-L417","documentation":"execute() requires the Minecraft client jar path (minecraftJar) to be a regular file before extracting data files and running processors. If it is missing, FileNotFoundException(\"Minecraft client JAR not found: <path>\") is thrown with the path appended. Forge's processors need the vanilla client jar as input, so installation aborts.","triggerScenarios":"ForgeNewInstallTask.execute() called when Files.isRegularFile(minecraftJar) is false — the vanilla game jar was never downloaded, was deleted, or the supplied path is wrong (e.g. jar not yet installed for that version).","commonSituations":"Installing Forge on a fresh instance before vanilla assets were downloaded; user manually deleted versions/<v>/<v>.jar; game directory moved/renamed; version isolated instances pointing at a non-existent jar.","solutions":["Download the vanilla client for that version first (launch vanilla once, or let HMCL install the game files), then install Forge","Verify versions/<minecraft-version>/<minecraft-version>.jar exists in the game repository","Restore the jar from recycle bin/backup or reinstall the instance","Check that the instance's game directory setting points to the right folder"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// ensure the vanilla client jar exists before installing Forge\nPath jar = gameDir.resolve(\"versions/\" + mcVersion + \"/\" + mcVersion + \".jar\");\nif (!Files.isRegularFile(jar)) downloadVanillaClient(mcVersion);","typeGuard":null,"tryCatchPattern":"try { installTask.execute(); } catch (FileNotFoundException e) { if (e.getMessage().startsWith(\"Minecraft client JAR not found\")) { installVanillaFirst(mcVersion); } else throw e; }","preventionTips":["Always download/launch vanilla for the version before installing Forge","Do not delete versions/<v>/<v>.jar manually","Fix instance game-directory settings after moving instances","Back up the versions directory before cleanup"],"tags":["java","filenotfound","minecraft-jar","forge-installer"],"backgroundTag":"file-not-found","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"}