How to install Scala CentOS 9 stream

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

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:

1.- Install Scala on CentOS 9 Stream
1.- Install Scala on CentOS 9 Stream

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

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Angelo
Angelo
I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook