{"record":{"id":"4eccb7816989f248","repo":"HMCL-dev/HMCL","slug":"unknown-architecture","errorCode":null,"errorMessage":"Unknown architecture: ","messagePattern":"Unknown architecture: ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/java/JavaInfo.java","lineNumber":80,"sourceCode":"\n    public static JavaInfo fromReleaseFile(BufferedReader reader) throws IOException {\n        Map<String, String> properties = KeyValuePairUtils.loadProperties(reader);\n        String osName = properties.get(\"OS_NAME\");\n        String osArch = properties.get(\"OS_ARCH\");\n        String vendor = properties.get(\"IMPLEMENTOR\");\n\n        OperatingSystem os = \"\".equals(osName) && \"OpenJDK BSD Porting Team\".equals(vendor)\n                ? OperatingSystem.FREEBSD\n                : OperatingSystem.parseOSName(osName);\n\n        Architecture arch = Architecture.parseArchName(osArch);\n        String javaVersion = properties.get(\"JAVA_VERSION\");\n\n        if (os == OperatingSystem.UNKNOWN)\n            throw new IOException(\"Unknown operating system: \" + osName);\n\n        if (arch == Architecture.UNKNOWN)\n            throw new IOException(\"Unknown architecture: \" + osArch);\n\n        if (javaVersion == null)\n            throw new IOException(\"Missing Java version\");\n\n        return new JavaInfo(Platform.getPlatform(os, arch), javaVersion, vendor);\n    }\n\n    public static <F, E extends ArchiveEntry> JavaInfo fromArchive(ArchiveFileTree<F, E> tree) throws IOException {\n        if (tree.getRoot().getSubDirs().size() != 1 || !tree.getRoot().getFiles().isEmpty())\n            throw new IOException();\n\n        ArchiveFileTree.Dir<E> jdkRoot = tree.getRoot().getSubDirs().values().iterator().next();\n        E releaseEntry = jdkRoot.getFiles().get(\"release\");\n        if (releaseEntry == null)\n            throw new IOException(\"Missing release file\");\n\n        JavaInfo info;\n        try (BufferedReader reader = new BufferedReader(new InputStreamReader(tree.getInputStream(releaseEntry), StandardCharsets.UTF_8))) {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/java/JavaInfo.java#L62-L98","documentation":"JavaInfo.fromReleaseFile() maps the OS_ARCH property via Architecture.parseArchName(). When the architecture is not recognized (Architecture.UNKNOWN), it throws IOException(\"Unknown architecture: <osArch>\") because there is no matching Platform combining OS and architecture.","triggerScenarios":"A Java installation whose release file has an OS_ARCH value not handled by Architecture.parseArchName (e.g. unusual casing/spelling, riscv/loongarch builds on an older HMCL, or missing OS_ARCH giving null).","commonSituations":"Running niche or newly released architectures (riscv64, loongarch64) on an older launcher that doesn't know them; custom-built JDKs with a nonstandard OS_ARCH string; package-manager JREs with odd arch labels.","solutions":["Update HMCL to a version whose Architecture.parseArchName supports this architecture string","Edit the release file's OS_ARCH to a canonical value (e.g. x86_64, aarch64) if you control the distribution","Use an officially supported Java build for your platform instead","Catch the IOException in the Java scan and exclude this runtime"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Properties rel = new Properties();\nrel.load(Files.newInputStream(javaHome.resolve(\"release\")));\nString arch = rel.getProperty(\"OS_ARCH\");\nif (arch == null || Architecture.parseArchName(arch) == Architecture.UNKNOWN) {\n    skipThisJavaInstallation();\n}","typeGuard":null,"tryCatchPattern":"try {\n    JavaInfo info = JavaInfo.fromReleaseFile(javaHome);\n} catch (IOException e) {\n    skipUnsupportedArch(javaHome); // continue scan\n}","preventionTips":["Prefer standard JDK builds with canonical OS_ARCH values (x86_64, aarch64)","Update HMCL when running on emerging architectures","Sanitize the release file if you control custom builds","Treat unknown-arch runtimes as non-candidates in the Java list"],"tags":["java-runtime","architecture","platform-detection"],"backgroundTag":"unsupported-platform","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}