Tuesday, March 24, 2015

Installing SBT (Simple Build Tool) on Ubuntu

Environment

  1. SBT 0.13.8
  2. Ubuntu 14.10
sbt is an open source build tool for Scala and Java projects, similar to Java's Maven or Ant. Its main features are: native support for compiling Scala code and integrating with many Scala test frameworks.



Installing SBT


The following commands have been tested, and are operational, under Ubuntu 14.10
mkdir ~/sbt
cd ~/sbt
wget https://dl.bintray.com/sbt/native-packages/sbt/0.13.8/sbt-0.13.8.tgz
sudo tar -zxvf sbt-0.13.8.tgz

This script will create an sbt folder in the home directory, get the latest (at the time of this article) sbt tgz file and unpackage it.


Modifying the Path


Modify both the PATH and CLASSPATH to point to the new Scala installation.

I like to use nano to edit my environment file:
sudo nano /etc/environment

The text in bold was added:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/craig/sbt/bin"  
...  
export SBT_HOME=/home/craig/sbt

Once the environment file is saved, reload it:
source /etc/environment



Verify the Installation


If the installation and environment editing were both successful, you should be able to find the version of scala on the terminal session:
craig@spark:~$ sbt --version
sbt launcher version 0.13.8



References

  1. [SBT] Installing SBT on Debian

1 comment:

  1. excellent piece of information, and let me tell you, your site gives the best and the most interesting information. This is just the kind of information that i had been looking for, i'm already your rss reader now and i would regularly watch out for the new posts, once again hats off to you! Thanx a lot once again, Regards, devops training in hyderabad

    ReplyDelete