How to install Scala in CentOS/RedHat Linux

Scala is an acronym for “Scalable Language”. This means that Scala grows with you. You can play with it by typing one-line expressions and observing the results. Scala is a pure-bred object-oriented language. Conceptually, every value is an object and every operation is a method-call. Scala is the preferred workhorse language for many mission critical server systems. The generated code is on a par with Java’s and its precise typing means that many problems are caught at compile-time rather than after deployment.

Step 1: Download  RPM file of Scala 2.12.0 using below commands:

wget http://www.scala-lang.org/files/archive/scala-2.12.0-M5.rpm

Step 2: Install the RPM:

[root@aodba]# rpm -ihv scala-2.12.0-M5.rpm
Preparing...                ########################################### [100%]
   1:scala                  ########################################### [100%]

Step 3: Check the Scala installation:

[root@aodba]# scala -version
Scala code runner version 2.12.0-M5 -- Copyright 2002-2016, LAMP/EPFL

Step 4: Update SCALA_HOME:

  • Update /etc/profile file.
echo ""  /etc/profile
echo "#Setting SCALA_HOME"  /etc/profile
echo "export SCALA_HOME=/usr/share/scala/bin"  /etc/profile
source /etc/profile
  • this way all users can use Scala.
Your journey into Scala start here ... !!