version

How to set the Java version on Mac OS X (macOS) systems alvin July 20, 2016 - 8:11pm

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) alvin July 27, 2013 - 3:32pm

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.