mirror of https://github.com/sbt/sbt.git
Use JAVA_HOME when available
This commit is contained in:
parent
0906b2d7ac
commit
e854909592
|
|
@ -81,6 +81,9 @@ object Util:
|
|||
}
|
||||
|
||||
lazy val javaHome: Path =
|
||||
if sys.props("java.home").endsWith("jre") then Paths.get(sys.props("java.home")).getParent()
|
||||
else Paths.get(sys.props("java.home"))
|
||||
sys.env.get("JAVA_HOME") match
|
||||
case Some(home) => Paths.get(home)
|
||||
case None =>
|
||||
if sys.props("java.home").endsWith("jre") then Paths.get(sys.props("java.home")).getParent()
|
||||
else Paths.get(sys.props("java.home"))
|
||||
end Util
|
||||
|
|
|
|||
Loading…
Reference in New Issue