version

SBT: 'compiler-interface' not yet compiled for Scala 2.12.2. Compiling... alvin August 18, 2017 - 6:34pm

SBT FAQ: What does the message, “'compiler-interface' not yet compiled for Scala 2.12.2. Compiling...” mean?

Answer: I don’t know all of the nitty-gritty details, but the short version of the answer is described in the SBT docs:

How to set the Java version on Mac OS X (macOS) systems

I don’t remember where I first found this line of code, but if you put it in your Mac OS X ~/.bash_profile file, it’s an easy way to set your Mac Java version:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

I can confirm this works with the Bash shell on Mac OS X 10.10. When I run the java -version command after opening a new Mac Terminal window, the output is 1.8.0_25.

A slightly more difficult way to set your Mac Java version is to look under the /Library/Java/JavaVirtualMachines directory to see which versions are installed, and then manually set the version.

SBT: How to control which version of a managed dependency is used

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is a short recipe, Recipe 18.5, “SBT: How to control which version of a managed dependency is used.”

Problem

You want to make sure you always have the desired version of a managed dependency, including the latest integration release, milestone release, or other versions.

How to generate Scala documentation with the ‘scaladoc’ command

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 14.8, “How to generate Scala documentation with the scaladoc command.”

Problem

You’ve annotated your Scala code with Scaladoc, and you want to generate developer documentation for your API.

Upgrading a Play Framework application (to 2.2.2)

When you upgrade a Play Framework application from one version to another, such as from 2.1.x to 2.2.x, you have to update a few files. I’m currently upgrading an app from 2.1.x to 2.2.x, and had to change my project/build.properties file to this:

sbt.version=0.13.1

I also had to upgrade my project/plugins.sbt file to this:

Scala 2.10 and Akka 2.0 and 2.1 import problems (Await, Future, Duration)

As a quick note, import statements that used to be like this with Akka 2.0:

import akka.dispatch.Await
import akka.dispatch.Future
import akka.util.duration._

are now like this with Akka 2.1 and Scala 2.10.x:

import scala.concurrent.{Await, Future}
import scala.concurrent.duration._

The Duration object in Akka 2.0 has also been moved, and it’s now included with the scala.concurrent.duration._ import statement.