Hello, friends. In this post, you will learn how to install Scala on CentOS 9. This programming language runs on the Java JVM, so they share many things.
Referring to Wikipedia:
Scala is a multi-paradigm programming language designed to express common programming patterns in a concise, elegant and type-safe way. It subtly integrates features of functional and object-oriented languages.
As I mentioned before, it runs on the Java virtual machine, so they share certain functionalities. It is also an open-source language that has the support of big companies like Twitter and Spotify.
Let’s install it for you to try it out.
Install Scala on CentOS 9 Stream
First, we need to make sure that Java and some dependencies are on the system:
sudo dnf install java-11-openjdk curl gzip
Then show the Java version
java -- version
The Scala developers provide a simple installation script that we can use for the installation to make sure there are no surprises.
All we have to do is run this command
curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz | gzip -d > cs && chmod +x cs && ./cs setup
Then we will be asked a question for the language configuration:
Should we add ~/.local/share/coursier/bin to your PATH via ~/.profile, ~/.bash_profile? [Y/n] Y
At the end, you will see something like this:
Log out and log back in, and now check the installed version of Scala.
scala --version
Scala code runner version 3.1.2 -- Copyright 2002-2022, LAMP/EPFL
Conclusion
Scala is a new programming language in which we will be able to do many interesting things having Java as a backend.
More posts about CentOS 9 Stream