One of the other things I’m trying to learn on my free time is Scala, like Groovy it’s a language that runs on top of the JVM and is both a object-oriented and functional programming language. One of the biggest places I know where its being used is Foursquare
Head to the Scala home page at http://www.scala-lang.org and click on the ‘Download Scala’ which is on the right side of the page. Download the scala-184.108.40.206.tgz (which is the latest as of writing this posting).
If you just want to download it from the command line,
$ curl -O http://www.scala-lang.org/downloads/distrib/files/scala-220.127.116.11.tgz
If you want to ensure the file is downloaded correctly checkout the MD5 file.
$ curl http://www.scala-lang.org/downloads/distrib/files/scala-18.104.22.168.tgz.md5 10d01410fd75019fa21a88964462a077 $ md5 scala-22.214.171.124.tgz MD5 (scala-126.96.36.199.tgz) = 10d01410fd75019fa21a88964462a077
Now that we have the file we need to untar it, move it /usr/share and make the link to Scala for it.
$ tar -xzf scala-188.8.131.52.tgz $ sudo mv scala-184.108.40.206 /usr/share/ $ sudo ln -s scala-220.127.116.11/ scala
Last step is to update your .profile file within your home folder. Just add this to the top:
SCALA_HOME=/usr/share/scala; export SCALA_HOME PATH=$SCALA_HOME/bin:$PATH; export PATH
Close all Terminals and reopen one. To test to see if everything is setup right, run this:
$ scala Welcome to Scala version 18.104.22.168 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_24). Type in expressions to have them evaluated. Type :help for more information. scala>
After all this you should be all set to start working with Scala. If the time comes and you want to upgrade, all you need to do is download, unzip and move to /usr/share folder and update the symbolic link like so:
$ cd /usr/share/ $ sudo rm scala $ sudo ln -s scala-22.214.171.124/ scala
If you have any questions or comments please post, also any suggestions on improving this are welcome.