Thursday 2 June 2016

Scala Installation

Scala is an "object-functional" programming language and it runs on Java platform(Java Virtual Machine). It interoperates with both Java and Javascript. Scala is the implementation language of important frameworks, including Apache Spark, Kafka and Akka.

Install Scala on Ubuntu 15.04
Scala needs Java Runtime 1.6 or later; You can ski installing Java if you already meet this requirement.

Check java version by:
$ java -version
Output :
openjdk version "1.8.0_45-internal"
OpenJDK Runtime Environment (build 1.8.0_45-internal-b14)
OpenJDK Server VM (build 25.45-b02, mixed mode)

Download Scala from here.
$ sudo mkdir /usr/local/src/scala
$ sudo tar xvf scala-2.11.8.tgz -C /usr/local/src/scala/

For quick access add scala and scalac to your path:
$ vi .bashrc
Add the following lines at the end:
export SCALA_HOME=/usr/local/src/scala/scala-2.11.8
export PATH=$SCALA_HOME/bin:$PATH
restart bashrc:
$ . .bashrc

Check scala version:
$ scala -version
Output will be like this:
Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL

No comments:

Post a Comment