{"record":{"id":"7b4c9401a9ccdbf2","repo":"HMCL-dev/HMCL","slug":"minecraft-client-jar-not-found-minecraftjar","errorCode":null,"errorMessage":"Minecraft client JAR not found: ${minecraftJar}","messagePattern":"Minecraft client JAR not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/download/neoforge/NeoForgeOldInstallTask.java","lineNumber":383,"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(\"neoforge_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":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/download/neoforge/NeoForgeOldInstallTask.java#L365-L401","documentation":"Thrown at the start of NeoForgeOldInstallTask.execute() when the Minecraft client JAR (minecraftJar path) is not a regular file. The installer needs the actual client jar to patch, so installation aborts immediately.","triggerScenarios":"Calling execute() after the minecraftJar Path was never downloaded, points to a deleted temp file, or points to a directory/symlink that does not resolve to a regular file.","commonSituations":"User cancelled the vanilla client download, version isolation removed the jar, wrong game repository path, or a prior task step failed silently leaving no client jar.","solutions":["Ensure the vanilla Minecraft client JAR is downloaded/validated before running the NeoForge installer.","Check the path stored in minecraftJar exists: Files.isRegularFile(path).","Re-add or repair the game version so the client jar is restored."],"exampleFix":"// before\nNeoForgeOldInstallTask task = new NeoForgeOldInstallTask(dep, manifest, jar, profile);\ntask.execute(); // throws if jar missing\n// after\nif (!Files.isRegularFile(clientJar)) {\n    await(new GameDownloadTask(...)); // ensure client jar first\n}\ntask.execute();","handlingStrategy":"validation","validationCode":"if (!Files.isRegularFile(minecraftJar))\n    throw new IllegalStateException(\"Client JAR missing, download vanilla client first: \" + minecraftJar);","typeGuard":null,"tryCatchPattern":"try {\n    await(task);\n} catch (FileNotFoundException e) {\n    // ensure vanilla client download task completes first, then retry\n    await(new GameDownloadTask(dependencyManager, manifest, 'client', gameVersion));\n    await(task);\n}","preventionTips":["Always complete the vanilla client download task before component installs","Never delete or move the client jar between task steps","Check Files.isRegularFile before executing install tasks"],"tags":["file-not-found","minecraft-client","neoforge","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"}