Skip to content

Instantly share code, notes, and snippets.

@multidis
Created November 24, 2013 00:36
Show Gist options
  • Save multidis/7621868 to your computer and use it in GitHub Desktop.
Save multidis/7621868 to your computer and use it in GitHub Desktop.
Scala development tools and related additions: setup form Ubuntu 12.04.

Scala development setup

First verify java JDK: openjdk-7-jdk as in Ubuntu workstation setup.

Scala sbt

  • Download latest tarball from scala-sbt page. CAUTION: do not try deb-file.
  • Uppack somewhere and add ...sbt/bin to ~/.bashrc
  • Verify: in new terminal sbt -h

NOTE: sbt provides interactive console with scala interpreter (REPL "read-eval-print loop") without installing the full scala distribution (that would provide scala command instead).

Interactive console with sbt

  • cd project directory, sbt to start sbt-shell (exit to quit)
  • console to start interactive interpreter (ctrl d to switch back)

NOTE: interpreter console will start only if the code compiles without errors.

Intractive console from a new (empty) dir: cd there and sbt console. After some setup/downloads interactive Scala console will be available.

Other key sbt commands

  • compile
  • styleCheck
  • test (if unit tests are included)
  • run (if some object provides main method or extends App trait)

Eclipse

Scala IDE, Scala Worksheet etc. bundle from scala-ide page: choose Linux 64-bit download. Unpack, create shortcut for Eclipse.

Once Eclipse starts, scala worksheet option should be available for interactive work.

Eclipse tweaks for Scala IDE

Expect huge memory use. Some tweaks for ScalaIDE are to be implemented in Eclipse.

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