linux jre missing folders (#99)

* linux jre missing folders

* linux jre missing folders
This commit is contained in:
Wyatt Verchere 2023-04-27 08:38:35 -07:00 committed by GitHub
parent bda63d5d64
commit dcca0ef474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -157,9 +157,18 @@ pub async fn get_all_jre() -> Result<Vec<JavaVersion>, JREError> {
r"/opt/jdks",
];
for path in java_paths {
jre_paths.insert(PathBuf::from(path).join("jre").join("bin"));
jre_paths.insert(PathBuf::from(path).join("bin"));
let path = PathBuf::from(path);
jre_paths.insert(PathBuf::from(&path).join("jre").join("bin"));
jre_paths.insert(PathBuf::from(&path).join("bin"));
if path.is_dir() {
for entry in std::fs::read_dir(&path)? {
let entry_path = entry?.path();
jre_paths.insert(entry_path.join("jre").join("bin"));
jre_paths.insert(entry_path.join("bin"));
}
}
}
// Get JRE versions from potential paths concurrently
let j = check_java_at_filepaths(jre_paths)
.await?