Skip to content

Commit

Permalink
Ultimate: fix search for available java
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maul-esel committed Nov 6, 2024
1 parent 343059b commit 3cc5b52
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions benchexec/tools/ultimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3cc5b52

Please sign in to comment.