From dcca0ef47499cede80b90f630a7ef32ace263394 Mon Sep 17 00:00:00 2001 From: Wyatt Verchere Date: Thu, 27 Apr 2023 08:38:35 -0700 Subject: [PATCH] linux jre missing folders (#99) * linux jre missing folders * linux jre missing folders --- theseus/src/util/jre.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/theseus/src/util/jre.rs b/theseus/src/util/jre.rs index dcc48c785..9e07034fa 100644 --- a/theseus/src/util/jre.rs +++ b/theseus/src/util/jre.rs @@ -157,9 +157,18 @@ pub async fn get_all_jre() -> Result, 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?