* Bazel's hermetic java, from `SE_BAZEL_JAVA_LOCATION` (a file holding the `$(JAVA)` path). * @return {(string|undefined)} the java executable, or undefined to use the server's default.
()
| 605 | * @return {(string|undefined)} the java executable, or undefined to use the server's default. |
| 606 | */ |
| 607 | function bazelJava() { |
| 608 | const javaLocation = process.env['SE_BAZEL_JAVA_LOCATION'] |
| 609 | if (!javaLocation) { |
| 610 | return undefined |
| 611 | } |
| 612 | // $(JAVA) is an exec path (external/<repo>/...); without the prefix it is a runfiles path. |
| 613 | const execPath = fs.readFileSync(locate(javaLocation), { encoding: 'utf8' }).trim() |
| 614 | const java = locate(execPath.replace(/^external\//, '')) |
| 615 | // Resolve the JDK symlink to its real path to dodge a Windows JVM bug mapping lib\modules. |
| 616 | return process.platform === 'win32' ? fs.realpathSync(java) : java |
| 617 | } |
| 618 | |
| 619 | /** Browser name -> [driver env var, browser env var, vendor options key], for pinned browsers. */ |
| 620 | const PINNED_BROWSERS = { |