How to update Scala Version in Ubuntu

Viewed 14604

In Ubuntu terminal when I write the command below:

scala -version

It gives the following Output:

Scala code runner version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL

I want to update this to 2.11.8. I downloaded the tar file

scala-2.11.8.tgz

and untared it to get

scala-2.11.8

folder in "/home/hdadmin/" location.

But still when I check the scala-version again it shows the same 2.9.2 version. It is picking scala version from

/usr/bin/scala

instead of

/home/hdadmin/scala-2.11.8

Is there a way to change this path?

I tried uninstalling & reinstalling scala using commands below:

sudo apt-get remove scala
sudo apt-get remove scala-library scala
sudo apt-get install scala

But the same version(2.9.2) gets installed because I think it comes by default with Java(1.8) that I have. There are some very unclear option online to update using sbt or deb or in the link http://osgux.tumblr.com/post/44635945407/install-scala-2-10-0-in-ubuntu.

I need to know if there is a direct way to update scala version.

3 Answers

You can try SKDMAN, perhaps the easiest way to manage versions of not only scala, but also java, sbt and spark (among other things).

Related