From 3cc5b52c8c39341392102efba3643faca1d3dff2 Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Wed, 6 Nov 2024 18:21:46 +0100 Subject: [PATCH] Ultimate: fix search for available java The previous search failed to use the java version on the PATH, as glob.glob("java") always returned the empty list. The new version coincides more closely with the implementation in the Ultimate.py wrapper script, and thus should ensure that the same java version is used from the tool info module and by Ultimate itself. --- benchexec/tools/ultimate.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/benchexec/tools/ultimate.py b/benchexec/tools/ultimate.py index 219a735d9..95c358d25 100644 --- a/benchexec/tools/ultimate.py +++ b/benchexec/tools/ultimate.py @@ -475,11 +475,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