{"record":{"id":"5e1d2c75d374a2d8","repo":"SeleniumHQ/selenium","slug":"downloaded-archive-did-not-contain-expected-java-r","errorCode":null,"errorMessage":"Downloaded archive did not contain expected Java runtime structure in {} or {}","messagePattern":"Downloaded archive did not contain expected Java runtime structure in (.+?) or (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"rust/src/jre.rs","lineNumber":159,"sourceCode":"        }\n    }\n\n    if extracted_root.is_none() {\n        for entry in fs::read_dir(&install_parent)? {\n            let entry = entry?;\n            let path = entry.path();\n            if path.is_dir()\n                && !entries_before_uncompress.contains(&path)\n                && find_java_binary(&path).is_some()\n            {\n                extracted_root = Some(path);\n                break;\n            }\n        }\n    }\n\n    let extracted_root = extracted_root.ok_or_else(|| {\n        anyhow!(\n            \"Downloaded archive did not contain expected Java runtime structure in {} or {}\",\n            temp_extract.display(),\n            install_parent.display()\n        )\n    })?;\n\n    if extracted_root != install_root {\n        fs::rename(&extracted_root, &install_root)?;\n    }\n\n    // Clean up temporary extraction directory\n    if temp_extract.exists() && temp_extract != install_root {\n        fs::remove_dir_all(&temp_extract)?;\n    }\n\n    let runtime = detect_managed_jre_candidate(&install_root)?.ok_or_else(|| {\n        anyhow!(format!(\n            \"Downloaded Java runtime but failed to resolve java binary in {}\",","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rust/src/jre.rs#L141-L177","documentation":"Error \"Downloaded archive did not contain expected Java runtime structure in {} or {}\" thrown in SeleniumHQ/selenium.","triggerScenarios":"Thrown at rust/src/jre.rs:159 when the library encounters an invalid state.","commonSituations":"Occurs when the downloaded Java runtime archive does not contain the expected directory structure, usually from a corrupted download or upstream packaging change. Clear the Selenium Manager cache and retry; if persistent, report the upstream layout change.","solutions":["Delete the JRE folder under the cache directory so Selenium Manager re-downloads the runtime","Verify the Adoptium download completed (check network/proxy settings and retry)","Install a JDK/JRE manually and ensure it is on PATH so Selenium Manager can use the system Java"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}