3

How to install Scala 2.9 nightly build on Ubuntu?

Seth Tisue
  • 28,052
  • 11
  • 78
  • 142
Łukasz Lew
  • 43,526
  • 39
  • 134
  • 202
  • if you're on Scala 2.11 or 2.12, instead of actually installing a nightly, consider just letting sbt pull the JARs down for you as needed; see http://stackoverflow.com/q/40622878/86485 – Seth Tisue Nov 17 '16 at 20:09

2 Answers2

3

You have to do it by hand. I usually put my builds in

/usr/share/scala

but there are other places that make sense. Anyway, I'd start off by

sudo mkdir /usr/share/scala
cd /usr/share/scala
tar zxf scala-2.9.0.r24301-b20110218020036.tgz
ln -s scala-2.9.0.r24301-b20110218020036 2.9

Now we've got Scala in place and we have a soft link to /usr/share/scala/2.9 that we can keep pointing at new builds as we unpack them.

If you have Ubuntu's out-of-date Scala installed, you'll probably want to replace or rename those commands. Ubuntu places Scala commands in /usr/local/bin/, so you need to re-point those to the right place:

sudo mv /usr/local/bin/scala /usr/local/bin/oldscala
sudo ln -s /usr/share/scala/2.9/bin/scala /usr/local/bin/scala
# same thing for scalac, fsc, scaladoc

and then you should be set. Ubuntu doesn't bother setting environment variables, and Scala works fine without it.

Seth Tisue
  • 28,052
  • 11
  • 78
  • 142
Rex Kerr
  • 162,454
  • 26
  • 308
  • 402
  • This wiki page maintains a step by step description for all OSes http://dcglab.kaist.ac.kr/wiki/index.php/Scala_Installation_Manual#Using_Scala_Installer_.28All_platform.29 – djondal Jun 13 '11 at 22:22
3

Just extract it someplace and make sure its bin subdirectory is on the PATH, as well as java.

Daniel C. Sobral
  • 284,820
  • 82
  • 479
  • 670
  • 1
    Nice short answer, but it's a little too short if Ubuntu's Scala is already installed. You have to make sure its path appears before the pre-installed Scala. – Rex Kerr Feb 18 '11 at 17:36
  • @Rex Well, there's always your answer. :-) By the way, you can improve on it by explaining how to get scala's bash completion working too. – Daniel C. Sobral Feb 18 '11 at 19:56
  • It's not hard to make sure your path comes first--you just have to remember to do it! (And make sure it is loaded everywhere it's needed, which is slightly less obvious but still quite doable.) However, Bash completion annoys me. No thanks! I refer the interested to http://www.debian-administration.org/article/An_introduction_to_bash_completion_part_1 – Rex Kerr Feb 18 '11 at 20:36