0

How to install Scala in Ubuntu 14.04 LTS

This post demonstrates how to install Scala in Ubuntu 14.04 LTS.

JDK is required

Before you can compile and run a Scala program, you need to have a JDK installed in your system. For instance, I am using OpenJDK 1.7.0_95 in Ubuntu.

Screenshot from 2016-02-25 01:33:02

Download Scala

Next, download Scala from http://www.scala-lang.org/download

Screenshot from 2016-02-25 01:33:47

Extract compressed file

As of this writing, the latest release is 2.11.7 and can be downloaded as scala-2.11.7.tgz. The archived file contains the following directories.

Screenshot from 2016-02-25 01:45:41

The goodies are in the bin directory.

Screenshot from 2016-02-25 01:47:12

Take note of calac and scala. These are tools for compiling and running Scala applications, respectively.

Compiling a Scala program

Screenshot from 2016-02-25 01:53:45

Running a Scala program

Screenshot from 2016-02-25 01:54:08

Karl San Gabriel

Karl San Gabriel

Java and Enterprise Technologies Expert