I tried to install Scala 2.12.1 on my Mac (El Capitan) via Homebrew and also by downloading the binaries from https://www.scala-lang.org/download/.
Scala 2.12.1
In b
Opening up bin/scala, there's a line:
bin/scala
java_release="$(cat $JAVA_HOME/release | grep JAVA_VERSION)"
My $JAVA_HOME wasn't set. All fixed now.
$JAVA_HOME