Scala Installation in Ubuntu

In this post, we will describe the procedure for Scala Installation on Ubuntu Machine.


Below are the basic requirement for Scala installation on Ubuntu and getting started.

  • Java 1.5 or Later versions installed and JAVA_HOME environment variable set to Java installation directory

Scala Installation Procedure:

  • Download the latest stable version of Scala from Gzipped binary tar ball of scala-x.y.z.tgz format can be downloaded directly. In this post we are using, scala-2.11.7.tgz file.
  • Copy the tar ball into our preferred installation directory location (preferably into /opt/scala) and extract the gzipped file.

  • Set the Scala installation directory location to SCALA_HOME environment variable in .bashrc file.

Close and reopen terminal (or source .bashrc file) to take changes to the environment variables

Verify Scala Installation:

Lets verify the Scala installation on Ubuntu with $ scala -version command, which will display version details of Scala.

Example Run in Scala

We can run examples in Scala shell which is like any other CLI session, we can open scala shell with $ scala command

Hello World in Scala CLI

Script Execution:

Scripts will be executed by $ scala <script_path> command.

Short-cuts in Scala Shell:

  • Ctrl+A takes you to the beginning of the line and Ctrl+E to the end of the line.
  • Up/Down keys for accessing previous commands
  • Ctr+D quits the scala shell

Profile photo of Siva

About Siva

Senior Hadoop developer with 4 years of experience in designing and architecture solutions for the Big Data domain and has been involved with several complex engagements. Technical strengths include Hadoop, YARN, Mapreduce, Hive, Sqoop, Flume, Pig, HBase, Phoenix, Oozie, Falcon, Kafka, Storm, Spark, MySQL and Java.

Leave a comment

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