()
| 213 | |
| 214 | |
| 215 | def get_java_version(): |
| 216 | # Use javac to get the version of java since its output is more stable |
| 217 | # in format of "javac 1.8.0_265" or "19.0.2" |
| 218 | # so we need to capture both the major and minor version |
| 219 | javac = find_java_exe("javac") |
| 220 | output = subprocess.run([javac, "-version"], capture_output=True, text=True).stdout |
| 221 | match = re.search(r"javac (\d+\.\d+)", output) |
| 222 | if match: |
| 223 | return match.group(1) |
| 224 | else: |
| 225 | return None |
| 226 | |
| 227 | |
| 228 | def get_platform_info(): |
no test coverage detected