How to install Scala from the official Scala distribution

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 script:

# wget
# 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
# 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/

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:

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 *