{"record":{"id":"1c1e5ce7e6cf646b","repo":"HMCL-dev/HMCL","slug":"minecraft-client-jar-was-not-downloaded","errorCode":null,"errorMessage":"Minecraft client JAR was not downloaded","messagePattern":"Minecraft client JAR was not downloaded","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameDownloadTask.java","lineNumber":101,"sourceCode":"        cacheTask.storeTo(this::setResult);\n        dependencies.add(cacheTask);\n    }\n\n    /// Requests post-execution so the completed destination can be returned.\n    @Override\n    public boolean doPostExecute() {\n        return true;\n    }\n\n    /// Returns the downloaded or previously validated client JAR.\n    ///\n    /// @throws IOException if no regular cached JAR is available\n    @Override\n    public void postExecute() throws IOException {\n        @Nullable Path result = getResult();\n        //noinspection ConstantValue\n        if (result == null || !Files.isRegularFile(result)) {\n            throw new IOException(\"Minecraft client JAR was not downloaded\");\n        }\n    }\n}\n","sourceCodeStart":83,"sourceCodeEnd":105,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameDownloadTask.java#L83-L105","documentation":"GameDownloadTask.postExecute() verifies that the download actually produced a regular file at the result path. If getResult() is null (task never completed the download) or the path is not a regular file, it throws this IOException so callers do not treat a failed client JAR download as success.","triggerScenarios":"postExecute() is called after GameDownloadTask ran but the JAR download failed, was cancelled, was written to a different location, or the result path points to a directory/symlink target that no longer exists.","commonSituations":"Network interruption during client JAR download, antivirus quarantining the JAR, disk-full preventing the write, or a broken proxy/mirror returning no file.","solutions":["Re-run the version download task and check the network/mirror used for the client JAR.","Check disk free space and that no antivirus is deleting/quarantining the .jar in the versions folder.","Verify the versions/<id>/<id>.jar exists and is a regular file; delete leftovers and retry.","Inspect proxy/firewall settings that may drop large file downloads."],"exampleFix":"// before\nGameDownloadTask t = new GameDownloadTask(...);\nawait(t); // may 'finish' without a file\n// after\nGameDownloadTask t = new GameDownloadTask(...);\nawait(t);\nif (t.getResult() == null || !Files.isRegularFile(t.getResult())) {\n    await(new GameDownloadTask(...)); // retry once\n}","handlingStrategy":"try-catch","validationCode":"Path jar = versionsDir.resolve(id).resolve(id + \".jar\"); if (!Files.isRegularFile(jar) || Files.size(jar) < 1024) reDownload();","typeGuard":"boolean jarReady(GameDownloadTask t) { return t.getResult() != null && Files.isRegularFile(t.getResult()); }","tryCatchPattern":"try { await(gameDownloadTask); } catch (IOException e) { if (e.getMessage().contains(\"not downloaded\")) retryDownload(); else throw e; }","preventionTips":["Ensure stable network or wired connection for large JAR downloads","Exclude the game directory from antivirus real-time scanning","Keep several GB of free disk space","Use a reliable mirror/proxy"],"tags":["download","minecraft","file","network"],"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"}