{"record":{"id":"30254b20b9d26865","repo":"HMCL-dev/HMCL","slug":"game-processor-file-not-found-should-be-downloade","errorCode":null,"errorMessage":"Game processor file not found, should be downloaded in preprocess","messagePattern":"Game processor file not found, should be downloaded in preprocess","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/download/forge/ForgeNewInstallTask.java","lineNumber":114,"sourceCode":"\n                    if (!Objects.equals(code, value)) {\n                        Files.delete(artifact);\n                        LOG.info(\"Found existing file is not valid: \" + artifact);\n\n                        miss = true;\n                    }\n                } else {\n                    miss = true;\n                }\n            }\n\n            if (!processor.getOutputs().isEmpty() && !miss) {\n                return;\n            }\n\n            Path jar = gameRepository.getLayout().getArtifactFile(processor.getJar());\n            if (!Files.isRegularFile(jar))\n                throw new FileNotFoundException(\"Game processor file not found, should be downloaded in preprocess\");\n\n            String mainClass;\n            try (JarFile jarFile = new JarFile(jar.toFile())) {\n                mainClass = jarFile.getManifest().getMainAttributes().getValue(Attributes.Name.MAIN_CLASS);\n            }\n\n            if (StringUtils.isBlank(mainClass))\n                throw new Exception(\"Game processor jar does not have main class \" + jar);\n\n            List<String> command = new ArrayList<>();\n            command.add(JavaRuntime.getDefault().getBinary().toString());\n            command.add(\"-cp\");\n\n            List<String> classpath = new ArrayList<>(processor.getClasspath().size() + 1);\n            for (Artifact artifact : processor.getClasspath()) {\n                Path file = gameRepository.getLayout().getArtifactFile(artifact);\n                if (!Files.isRegularFile(file))\n                    throw new Exception(\"Game processor dependency missing\");","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/download/forge/ForgeNewInstallTask.java#L96-L132","documentation":"ProcessorTask.execute() throws FileNotFoundException when the processor's jar artifact is not a regular file in the game repository. Processor JARs are expected to have been downloaded in the preprocess (dependency/libraries download) stage; their absence means the required libraries were never fetched or were deleted. The processor cannot be launched without this JAR.","triggerScenarios":"Running a Forge processor after the libraries download stage skipped, failed silently, or stored files in a different repository location; calling ProcessorTask directly without GameLibrariesTask having completed; the repository path layout resolving processor.getJar() to a nonexistent file.","commonSituations":"Offline installation with missing libraries; a game directory with partially deleted 'libraries' folder; network failure during the dependent download task that was ignored; mismatched game repository (BASE directory) between sessions.","solutions":["Re-run the Forge installation so the dependent GameLibrariesTask downloads the processor libraries first","Check that the libraries directory contains the processor jar (e.g. libraries/net/minecraftforge/installertools/...)","Verify the game repository base directory points at the same location used during preprocessing","Fix network/proxy issues and retry the full download task rather than only running processors"],"exampleFix":"// before: running processors without downloading libraries\ntask.run();\n// after: ensure dependencies (library downloads) complete first\nTask<?> install = new ForgeNewInstallTask(dependencyManager, manifest, minecraftJar, version, installer);\ninstall.whenComplete(...); // dependencies include GameLibrariesTask + processorsTask","handlingStrategy":"validation","validationCode":"// Confirm processor jars exist before running the task\nPath jar = gameRepository.getLayout().getArtifactFile(processor.getJar());\nif (!Files.isRegularFile(jar)) {\n    throw new IOException(\"Preprocess missing processor jar: \" + jar + \"; re-run library downloads\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    installTask.run();\n} catch (FileNotFoundException e) {\n    if (e.getMessage().contains(\"preprocess\")) {\n        // re-run dependency downloads (GameLibrariesTask) then retry\n    }\n}","preventionTips":["Never delete files under the 'libraries' directory manually","Always run the full ForgeNewInstallTask (dependents download libraries) rather than processor subtasks alone","Ensure a stable network during the download phase"],"tags":["forge","file-not-found","download"],"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"}