Software Development

How to install Scala in Ubuntu 14.04 LTS

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

JDK is required

[wp_ad_camp_5]

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

[wp_ad_camp_4]

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

[wp_ad_camp_3]

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

Running a Scala program

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

Loading

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.


You Might Also Like