diff --git a/javabridge/locate.py b/javabridge/locate.py index 00aa98a..a5fcea2 100644 --- a/javabridge/locate.py +++ b/javabridge/locate.py @@ -132,9 +132,7 @@ def get_out(cmd): java_bin = get_out(["bash", "-c", "type -p java"]) java_dir = get_out(["readlink", "-f", java_bin]) java_version_string = get_out(["bash", "-c", "java -version"]) - if re.search('^openjdk', java_version_string, re.MULTILINE) is not None: - jdk_dir = os.path.join(java_dir, "..", "..", "..") - elif re.search('^java', java_version_string, re.MULTILINE) is not None: + if re.search('^(openjdk|java)', java_version_string, re.MULTILINE) is not None: jdk_dir = os.path.join(java_dir, "..", "..") else: raise RuntimeError(