One of our goals this year at the Scala Center is to streamline the distribution of Scala. I am opening this thread to get a picture as wide and accurate as possible about the current state of the installation procedure of Scala.
There are currently several ways to set up a Scala development environment, and I wonder if the one that we recommend on the getting started instructions is the best choice and, even if that’s the case, if there is anything we can do to make it even easier.
What I expect from the installation procedure is to:
- work everywhere (Windows, Linux, macOS)
- be simple (one step)
- be complete (after the setup, I should be able to build any Scala project — that can use any version of Scala)
The current recommendation is to use the Coursier setup script, which addresses all those requirements. It installs a JVM if needed, as well as the most common command-line tools (notably, scala-cli
— soon to be renamed to scala
—, sbt
, cs
, and scalafmt
), it works on all the operating systems, and it is just one command to invoke in a terminal (or one .exe to run, on Windows).
After the installation, you can use cs
to manage the JVM to use, and switch to a more recent one or an older one, if needed by your projects.
Overall, I think this solution works very well, although I noticed a few issues that would be nice to fix:
- on Linux and macOS you need to be careful about picking the right launcher for your architecture although it would be technically possible to have a single setup script that works for any *nix-like system (just like the
sbt
launcher works on any *nix-like system). The instructions would then be simplified to invokingcurl https://scala-lang.org/setup.sh | sh
(see coursier#2647) - updating the JVM does not work perfectly on Linux: e.g. in some cases you may still have the previous one on the
PATH
until the next reboot.
And you, what is your experience? How do you manage the installed JVM? What works well, and what does not work well, when a new colleague tries to set up their machine? What type of installer works best on Windows (currently, we distribute a .zip that contains a .exe)? What type of installer works best on macOS (e.g. Brew formula vs ad-hoc script)?
I am equally interested in hearing from people who do follow the recommended instructions, and those who don’t (in such a case, please explain why).