{"record":{"id":"351f13b35630d5b5","repo":"HMCL-dev/HMCL","slug":"unknown-operating-system","errorCode":null,"errorMessage":"Unknown operating system: ","messagePattern":"Unknown operating system: ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/java/JavaInfo.java","lineNumber":77,"sourceCode":"            return -1;\n        }\n    }\n\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\");","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/java/JavaInfo.java#L59-L95","documentation":"JavaInfo.fromReleaseFile() parses a JDK's release file and maps the OS_NAME property through OperatingSystem.parseOSName(). If the resulting OS is UNKNOWN (unrecognized os name or missing OS_NAME), it throws IOException(\"Unknown operating system: <osName>\") because HMCL cannot pick a platform for this Java installation.","triggerScenarios":"Scanning a Java installation whose release file has an OS_NAME that OperatingSystem.parseOSName does not recognize (typo, exotic distro string, or an empty/absent OS_NAME property, in which case osName is null).","commonSituations":"Manually built or patched JDK with a missing/modified release file; JREs (like old Java 8) that omit OS_NAME from the release file; custom lightweight runtimes (jlink images) without a release file; non-standard vendor distributions.","solutions":["Check the release file next to the java executable and set OS_NAME to a standard value (Linux/Windows/Mac OS X)","Use a full official JDK/JRE distribution that ships a proper release file","Update HMCL, since newer versions may recognize more OS names","Catch the IOException during Java scan and skip that installation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Properties rel = new Properties();\nrel.load(Files.newInputStream(javaHome.resolve(\"release\")));\nString osName = rel.getProperty(\"OS_NAME\");\nif (osName == null || OperatingSystem.parseOSName(osName) == OperatingSystem.UNKNOWN) {\n    skipThisJavaInstallation();\n}","typeGuard":null,"tryCatchPattern":"try {\n    JavaInfo info = JavaInfo.fromReleaseFile(javaHome);\n} catch (IOException e) {\n    markJavaInvalid(javaHome, e.getMessage()); // skip entry\n}","preventionTips":["Only register Java installations from full official distributions","Check the release file has OS_NAME before scanning","Keep HMCL updated for new OS name variants","Skip (don't fail) unrecognized runtimes during batch scans"],"tags":["java-runtime","platform-detection","parsing"],"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"}