{"record":{"id":"91dc67ae49ef956d","repo":"HMCL-dev/HMCL","slug":"unsupported-platform-operating-system-s-archite","errorCode":null,"errorMessage":"Unsupported platform: operating system %s, architecture %s","messagePattern":"Unsupported platform: operating system (.+?), architecture (.+?)","errorType":"exception","errorClass":"PatchException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/util/SelfDependencyPatcher.java","lineNumber":85,"sourceCode":"import static java.nio.charset.StandardCharsets.UTF_8;\nimport static java.util.stream.Collectors.toSet;\nimport static org.jackhuang.hmcl.util.gson.JsonUtils.listTypeOf;\nimport static org.jackhuang.hmcl.util.gson.JsonUtils.mapTypeOf;\nimport static org.jackhuang.hmcl.util.logging.Logger.LOG;\nimport static org.jackhuang.hmcl.util.i18n.I18n.i18n;\n\n// From: https://github.com/Col-E/Recaf/blob/7378b397cee664ae81b7963b0355ef8ff013c3a7/src/main/java/me/coley/recaf/util/self/SelfDependencyPatcher.java\npublic final class SelfDependencyPatcher {\n    private final List<DependencyDescriptor> dependencies = DependencyDescriptor.readDependencies();\n    private final List<Repository> repositories;\n    private final Repository defaultRepository;\n    private final byte[] buffer = new byte[IOUtils.DEFAULT_BUFFER_SIZE];\n    private final MessageDigest digest = DigestUtils.getDigest(\"SHA-1\");\n\n    private SelfDependencyPatcher() throws PatchException {\n        // We can only self-patch JavaFX on specific platform.\n        if (dependencies == null) {\n            throw new PatchException(\"Unsupported platform: operating system %s, architecture %s\".formatted(\n                    System.getProperty(\"os.name\"), System.getProperty(\"os.arch\")));\n        }\n\n        final String customUrl = System.getProperty(\"hmcl.openjfx.repo\");\n        if (customUrl == null) {\n            if (System.getProperty(\"user.country\", \"\").equalsIgnoreCase(\"CN\")) {\n                defaultRepository = Repository.TENCENTCLOUD_MIRROR;\n            } else {\n                defaultRepository = Repository.MAVEN_CENTRAL;\n            }\n            repositories = List.of(Repository.MAVEN_CENTRAL, Repository.TENCENTCLOUD_MIRROR);\n        } else {\n            defaultRepository = new Repository(String.format(i18n(\"repositories.custom\"), customUrl), customUrl);\n            repositories = List.of(Repository.MAVEN_CENTRAL, Repository.TENCENTCLOUD_MIRROR, defaultRepository);\n        }\n    }\n\n    private static final class DependencyDescriptor {","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/util/SelfDependencyPatcher.java#L67-L103","documentation":"SelfDependencyPatcher patches missing JavaFX dependencies at runtime, but only on platform combinations it has Maven artifacts for. The constructor throws PatchException when the internal dependencies map is null, meaning the current os.name/os.arch combination is not supported for JavaFX self-patching.","triggerScenarios":"Launching HMCL needing JavaFX patching on an unsupported OS/architecture pair (e.g. FreeBSD, Linux on riscv64/armv7, Windows on ARM), where the static dependency table was never initialized.","commonSituations":"Running HMCL on niche Linux architectures, ARM single-board computers, BSD systems, or unusual JVM os.arch values like aarch64 on unsupported OSes.","solutions":["Install a JDK that bundles JavaFX (e.g. Liberica Full, Azul Zulu FX) so patching is unnecessary","Provide JavaFX modules on the module path yourself (--module-path /lib/javafx --add-modules javafx.controls,...)","Use a supported platform (x64 Windows/Linux/macOS, common arm64 builds) or check the dependency table for your arch","Contribute/upstream support for your architecture by extending the dependency map"],"exampleFix":"// before\njava -jar HMCL.jar  # on unsupported arch, patcher throws\n// after: use a JavaFX-bundled JDK\n/path/to/liberica-full-jdk/bin/java -jar HMCL.jar\n// or supply JavaFX:\njava --module-path javafx-sdk/lib --add-modules javafx.controls,javafx.web -jar HMCL.jar","handlingStrategy":"validation","validationCode":"String os = System.getProperty(\"os.name\");\nString arch = System.getProperty(\"os.arch\");\nboolean supported = (os.contains(\"win\") || os.contains(\"linux\") || os.contains(\"mac\"))\n        && (arch.equals(\"amd64\") || arch.equals(\"x86_64\") || arch.equals(\"aarch64\"));\nif (!supported) {\n    // require a JavaFX-bundled JDK before launching HMCL\n}","typeGuard":null,"tryCatchPattern":"try {\n    SelfDependencyPatcher.patchIfNeeded();\n} catch (PatchException e) {\n    LOG.severe(\"JavaFX self-patching unsupported on this platform: \" + e.getMessage());\n    // prompt user to install a JDK with bundled JavaFX\n}","preventionTips":["Ship or recommend JavaFX-bundled JDKs (Liberica Full, Zulu FX) for exotic platforms","Check os.name/os.arch against the patcher's supported list before launching","Provide JavaFX modules via --module-path on unsupported architectures"],"tags":["javafx","platform","dependency"],"backgroundTag":"unsupported-platform","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}