9/2/2016 - 7:48 AM

scala installation on centos

scala installation on centos


#Step 1: Download Tarball OR RPM file of Scala 2.11.6 using below commands
cd /data
sudo wget http://downloads.typesafe.com/scala/2.12.0-M5/scala-2.12.0-M5.tgz

#Step 2: Installation
sudo cp /data/scala-2.12.0-M5.tgz /opt/
sudo cd /opt/
sudo tar -xvf scala-2.12.0-M5.tgz
sudo mv scala-2.12.0-M5 scala
sudo rm -f scala-2.12.0-M5.tgz

#Step 3: Configure scala, scalac, scaladoc and scalap commands using alternatives (in case you have done tarball installation)

sudo alternatives --install /usr/bin/scala scala /opt/scala/bin/scala 2 
sudo alternatives --install /usr/bin/scalac scalac /opt/scala/bin/scalac 2 
sudo alternatives --install /usr/bin/scaladoc scaladoc /opt/scala/bin/scaladoc 2 
sudo alternatives --install /usr/bin/scalap scalap /opt/scala/bin/scalap 2

#Step 4: Update SCALA_HOME for all users in any of below files

echo "" >> /etc/profile
echo "## Setting SCALA_HOME for all USERS ##" >> /etc/profile
echo "export SCALA_HOME=/opt/scala" >> /etc/profile
source /etc/profile