Closed
Description
Compiler version
Scala code runner version 3.1.1-RC1-bin-SNAPSHOT-git-3e192a3 -- Copyright 2002-2021, LAMP/EPFL
Minimized code
The following script attempts to print out the runtime scala install directory.
#!/usr/bin/env scala3
def main(args: Arra[String]): Unit =
println(sys.props("scala.home"))
Output
null
Expectation
should print the path to the runtime scala.
Note that there is no simple alternative to figuring out the path to the current runtime scala.
Different scripts can specify different versions of scala via the hashbang line, so environment variables can't be relied on.