Skip to content

Instantly share code, notes, and snippets.

@idarlington
Last active February 24, 2017 22:12
Show Gist options
  • Save idarlington/70ac73b1c08880f9a8ed18297ff04570 to your computer and use it in GitHub Desktop.
Save idarlington/70ac73b1c08880f9a8ed18297ff04570 to your computer and use it in GitHub Desktop.
Setting Up Scala

Installing Java

You can either install Oracle Java or OpenJDK (the Open Source implementation of Oracle Java)

Installing Oracle Java

Ubuntu

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

MacOS (via Homebrew)

brew update
brew tap caskroom/cask
brew install Caskroom/cask/java

Windows

Follow the instructions here and then set the JAVA_HOME environment variable

Installing OpenJDK

Ubuntu

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk

MacOS

Instructions on building OpenJDK

Windows

Follow the installation instructions here.

Installing Scala

Ubuntu

wget www.scala-lang.org/files/archive/scala-2.11.8.deb
sudo dpkg -i scala-2.11.8.deb

MacOs (with Homebrew)

 brew update
 brew install scala

Windows

  • Download .msi installer file from Scala Downloads page
  • Install Scala by double clicking .msi installer
  • This will install Scala on C:\Program Files (x86)\scala Or C:\Program Files\scala path
  • Go to My Comupter > Properties > Advance System Settings > Environment Variables
  • Create SCALA_HOME variable with the path where Scala is extracted
  • In our case it will be C:\Program Files\scala
  • Update/Create PATH variable and append ;%SCALA_HOME%/bin; to the value

Installing SBT

Sbt is the interactive build tool for Scala projects, used to manage dependencies and tasks in projects.

Ubuntu

echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt

MacOS

brew install sbt   

OR

port install sbt

Windows

Download and install the msi installer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment