{"record":{"id":"9257d751689c9007","repo":"SeleniumHQ/selenium","slug":"downloaded-java-runtime-but-failed-to-resolve-java","errorCode":null,"errorMessage":"Downloaded Java runtime but failed to resolve java binary in {}","messagePattern":"Downloaded Java runtime but failed to resolve java binary in (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"rust/src/jre.rs","lineNumber":176,"sourceCode":"    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 {}\",\n            install_root.display()\n        ))\n    })?;\n\n    Ok(runtime)\n}\n\nfn detect_managed_jre_candidate(install_root: &Path) -> Result<Option<JavaRuntime>, Error> {\n    if install_root.exists()\n        && let Some(runtime) = detect_managed_jre(install_root)?\n    {\n        return Ok(Some(runtime));\n    }\n\n    if let Some(parent) = install_root.parent()\n        && parent.exists()\n        && let Some(runtime) = detect_managed_jre(parent)?","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rust/src/jre.rs#L158-L194","documentation":"Error \"Downloaded Java runtime but failed to resolve java binary in {}\" thrown in SeleniumHQ/selenium.","triggerScenarios":"Thrown at rust/src/jre.rs:176 when the library encounters an invalid state.","commonSituations":"Occurs when the extracted Java runtime has no java binary where expected. Clear the Selenium Manager cache and re-download; verify the archive matched your OS/architecture.","solutions":["Delete the cached JRE directory to force a clean re-download","Check that the cache folder is writable and not blocked by antivirus","Install Java manually and make sure 'java' is on PATH"],"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"}