diff --git a/benchexec/tools/ultimate.py b/benchexec/tools/ultimate.py index 219a735d9..8cad56f69 100644 --- a/benchexec/tools/ultimate.py +++ b/benchexec/tools/ultimate.py @@ -467,6 +467,8 @@ def get_value_from_output(self, output, identifier): return None def get_java_installations(self): + # The code in this method is (and should remain) consistent with the method `get_java` in + # . candidates = [ "java", "/usr/bin/java", @@ -475,11 +477,16 @@ def get_java_installations(self): "/usr/lib/jvm/java-*-openjdk-amd64/bin/java", ] - candidates = [c for entry in candidates for c in glob.glob(entry)] + candidates_extended = [] + for c in candidates: + if "*" in c: + candidates_extended += glob.glob(c) + else: + candidates_extended += [c] pattern = r'"(\d+\.\d+).*"' rtr = {} - for c in candidates: + for c in candidates_extended: candidate = shutil.which(c) if not candidate: continue