Table of Contents
- Installation Environment & Software Prerequisites
- Step 1: Java-JDK Installation:
- Step 2: Download Scala:
- Step 3: Scala Installation:
- Step 4: Create a folder using mkdir command for saving Scala installation files
- Step 5: Extract tar file content using the tar command
- Step 6: Move folder content using mv command
- Step 7: Set permission using chmod command on scala folder
- Step 8: Run/Apply bashrc file changes
- What’s next?
In this article, we are going to cover Installing Scala on Ubuntu Linux.
Installing Scala on Ubuntu Linux is a relatively simple procedure which is described in following steps.
Installation Environment & Software Prerequisites
OS : Ubuntu Linux(14.04 LTS) – 64bit
Java : Oracle JDK 1.8
Scala : Scala-2.11.7
Step 1: Java-JDK Installation:
In one of our previous article, We have provided step by step guide to install Java in Ubuntu Linux, so we can skip this Java installation step here.
Step 2: Download Scala:
For Scala installation, we need to select appropriate Scala version.
In our case, we are interested in installing Scala-2.11.7.
We have downloaded Scala from link.
Step 3: Scala Installation:
Once the file is downloaded, we have to select appropriate location in the system to save the Scala.
I have selected the path like,
Step 4: Create a folder using mkdir command for saving Scala installation files
So, in order to save Scala files, we have to create a folder under
I have created a folder using below command,
$ sudo mkdir /usr/local/scala
Step 5: Extract tar file content using the tar command
Once the folder is created, we have to extract the file that we have downloaded from Scala’s website.
I have downloaded and placed that file to,
So I have to execute below command for extracting the file,
$ tar -xvf scala-2.11.7.tgz
Step 6: Move folder content using mv command
Now we have to move the extracted folder to the location at which we want to save (in our case
I have used below command to move the extracted files to
$ sudo mv scala-2.11.7 /usr/local/scala
Step 7: Set permission using chmod command on scala folder
Once the files are moved, it is time to get appropriate permissions on the folder,
I have used below command to acquire appropriate permission.
$ sudo chmod -R 777 /usr/local/scala/scala-2.11.7/
Now the setup part is almost done, we will start the configuration part,
In the configuration step, we have to set
SCALA_HOME variable, In order to set the variable, we have to add them in
I have used
gedit $HOME/.bashrccommand to open the file, you can use any of your favorite editor to open the file and append the below lines to that file.
After modifying the
.bashrcfile looks like the following snapshot.
Step 8: Run/Apply bashrc file changes
Now we have to execute the following command so that the
SCALA_HOMEvariable will take effect,
$ source $HOME/.bashrc
Once the configuration is complete, your scala is ready to use, so this is how you can install scala on ubuntu linux.
you can use scala command to start scala shell.
After Installing Scala on Ubuntu Linux, you might be interested in scala hello world example which can be found here.