tkroman
tkroman

Reputation: 4798

How do I tell sbt to use local scala installation?

Trying to learn how to use sbt and stuck with a situation: when I install sbt and run it for the first time, it tries to download scala 2.9.x into some directory inside my home. I have scala 2.10.2 installed somewhere else, so how do I tell sbt to use that scala distribution?

UPD.: Solution (this is distribution for sbt to use when building projects, but sbt will anyway download scala distribution needed for it itself):

***@***:~|⇒  cat .sbt/global.sbt
scalaVersion := "2.10.2"

scalaHome := Some(file("/usr/share/scala"))

Upvotes: 1

Views: 1830

Answers (1)

Rüdiger Klaehn
Rüdiger Klaehn

Reputation: 12565

You could copy the .jars of your distribution to ~/.ivy2/cache. But that would be totaly missing the point of using sbt. If you want to use scala 2.10.2, just put

scalaVersion := "2.10.2"

into your build.sbt, and it will download this version for you. Then if you want to update to 2.11 when it comes out, all you have to do is change a single line in your build.sbt.

Upvotes: 2

Related Questions