mirror of
https://github.com/enso-org/enso.git
synced 2024-11-26 17:06:48 +03:00
On MacOS, do not assume existence of Contents/Home
in the JDK binary path (#9684)
This commit is contained in:
parent
9d2d9038c9
commit
271a744b67
@ -31,10 +31,20 @@ case class GraalRuntime(version: GraalVMVersion, path: Path) {
|
||||
def javaHome: Path =
|
||||
OS.operatingSystem match {
|
||||
case OS.Linux => path
|
||||
case OS.MacOS => path / "Contents" / "Home"
|
||||
case OS.MacOS => findMacOSJavaPath()
|
||||
case OS.Windows => path
|
||||
}
|
||||
|
||||
/** The bin/ directory may or may not be inside Contents/Home, so check both
|
||||
* possibilities.
|
||||
*/
|
||||
def findMacOSJavaPath(): Path = {
|
||||
val contentsHomePath = path / "Contents" / "Home"
|
||||
if (Files.exists(contentsHomePath))
|
||||
contentsHomePath
|
||||
else path
|
||||
}
|
||||
|
||||
/** The path to the `java` executable associated with this runtime. */
|
||||
def javaExecutable: Path = {
|
||||
val executableName = if (OS.isWindows) "java.exe" else "java"
|
||||
|
Loading…
Reference in New Issue
Block a user