(exe_name="java")
| 202 | # If JAVA_HOME is set, use that, |
| 203 | # otherwise use the executable on the PATH. |
| 204 | def find_java_exe(exe_name="java"): |
| 205 | exe = None |
| 206 | if "JAVA_HOME" in os.environ: |
| 207 | exe = os.path.expandvars(f"$JAVA_HOME/bin/{exe_name}") |
| 208 | if exe is None: |
| 209 | exe = shutil.which(exe_name) |
| 210 | if exe is None: |
| 211 | raise RuntimeError(f"{exe_name} command not found.") |
| 212 | return exe |
| 213 | |
| 214 | |
| 215 | def get_java_version(): |
no outgoing calls
no test coverage detected