{"record":{"id":"d5a7362b79f56cd8","repo":"HMCL-dev/HMCL","slug":"failed-to-download-dependencies","errorCode":null,"errorMessage":"Failed to download dependencies","messagePattern":"Failed to download dependencies","errorType":"exception","errorClass":"PatchException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/util/SelfDependencyPatcher.java","lineNumber":182,"sourceCode":"        // Do nothing if JavaFX is detected\n        try {\n            Class.forName(\"javafx.application.Application\");\n            return;\n        } catch (Exception ignored) {\n        }\n\n        SelfDependencyPatcher patcher = new SelfDependencyPatcher();\n\n        // Otherwise we're free to download in Java 11+\n        LOG.info(\"Missing JavaFX dependencies, attempting to patch in missing classes\");\n\n        // Download missing dependencies\n        List<DependencyDescriptor> missingDependencies = patcher.checkMissingDependencies();\n        if (!missingDependencies.isEmpty()) {\n            try {\n                patcher.fetchDependencies(missingDependencies);\n            } catch (IOException e) {\n                throw new PatchException(\"Failed to download dependencies\", e);\n            }\n        }\n\n        // Add the dependencies\n        try {\n            patcher.loadFromCache();\n        } catch (IOException ex) {\n            throw new PatchException(\"Failed to load JavaFX cache\", ex);\n        } catch (ReflectiveOperationException | NoClassDefFoundError ex) {\n            throw new PatchException(\"Failed to add dependencies to classpath!\", ex);\n        }\n        LOG.info(\" - Done!\");\n    }\n\n    private Repository showChooseRepositoryDialog() {\n        final JPanel panel = new JPanel();\n        panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));\n","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/util/SelfDependencyPatcher.java#L164-L200","documentation":"During JavaFX dependency patching, HMCL checks which JavaFX artifacts are missing and downloads them. If fetchDependencies fails due to an I/O error (network failure, bad mirror, disk error), the patch() method wraps it in this PatchException and patching fails.","triggerScenarios":"SelfDependencyPatcher.patch() is called, checkMissingDependencies() returns a non-empty list, and patcher.fetchDependencies(missingDependencies) throws IOException — network outage, unreachable repository, or local disk failure.","commonSituations":"No internet or firewall blocking the OpenJFX Maven repo; misconfigured hmcl.openjfx.repo system property pointing at an invalid URL; proxy requirements on corporate networks; disk full in the cache directory.","solutions":["Check network connectivity / firewall access to the Maven repository hosting OpenJFX","Set -Dhmcl.openjfx.repo=<mirror-url> to a reachable mirror (e.g. a Chinese mirror if default repo is blocked)","Configure JVM proxy settings (-Dhttps.proxyHost/-Dhttps.proxyPort) for corporate networks","Use a JDK with bundled JavaFX so no download is needed; free disk space and retry"],"exampleFix":"// before\njava -jar HMCL.jar  # tries default repo, fails offline\n// after\njava -Dhmcl.openjfx.repo=https://mirrors.example.com/openjfx -jar HMCL.jar","handlingStrategy":"retry","validationCode":"// pre-check reachability of the OpenJFX repo\nHttpURLConnection c = (HttpURLConnection) new URL(repoUrl).openConnection();\nc.setConnectTimeout(5000);\nif (c.getResponseCode() != 200) {\n    LOG.warning(\"JavaFX repo unreachable; configure -Dhmcl.openjfx.repo\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    SelfDependencyPatcher.patchIfNeeded();\n} catch (PatchException e) {\n    if (e.getMessage().contains(\"download\")) {\n        LOG.warning(\"Dependency download failed (network/mirror?). Configure hmcl.openjfx.repo or check connectivity\", e);\n    }\n}","preventionTips":["Set a reachable -Dhmcl.openjfx.repo mirror up front (e.g. regional mirror)","Configure JVM proxy properties in restricted networks","Ensure disk space in the cache location before patching","Use a JavaFX-bundled JDK to eliminate runtime downloads"],"tags":["network","download","javafx"],"backgroundTag":"http-request-failed","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"}