How to install Scala from the official Scala distribution

Posted on In QA

How to install Scala from the official Scala distribution? This is needed on a Linux release with older version of Scala in the repository, e.g. Fedora 12.

Use the install-scala.sh script:

# wget https://raw2.github.com/zma/usefulscripts/master/script/install-scala.sh
# sh ./install-scala.sh VER

where VER is the scala version that you want to install.


First step, install and configure the Java environment of course.

Second, download the scala-2.9.2 package and decpress it:

# wget http://www.scala-lang.org/downloads/distrib/files/scala-2.9.2.tgz
# tar xf scala-2.9.2.tgz

We install (copy) it to the /opt/ directory:

# mv scala-2.9.2 /opt/

Set globally for all users to include the Scala-2.9.2 installed in their $PATH:

echo "export PATH=/opt/scala-2.9.2/bin/:$PATH" > /etc/profile.d/scala-2.9.2.sh

Alternatively, the $PATH setting can be added by users to their ~/.bashrc.

After re-logon, the users can use Scala now.

I summarize these steps and put them together in a script: install-scala-2.9.2.sh.

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *