mythicalprogrammer
mythicalprogrammer

Reputation: 4757

Need help getting sbt 0.10 to choose a local copy of scala 2.9.1.final on Ubuntu

What I have so far:

.bashrc
  2 PATH=/opt/scala-2.9.1.final/bin:$PATH
  3 PATH=/opt/sbt:$PATH

So my scala-2.9.1.final version is in the /opt folder. The same goes with sbt 0.10.

I'm trying to get it to pick my 2.9.1.final instead of 2.8 whatever. I've tried looking.

What i've done so far is putting symbolic links in projectname/boot/ directory.

ln -s /opt/scala-2.9.1.final scala-2.9.1.final

But it doesn't seem to work? I've also tried this build.sbt (https://github.com/VonC/xsbt-template/blob/master/build.sbt) and change the version to 2.9.1.final.

How do I get sbt>console to use 2.9.1.final? And how does it build using 2.9.1.final?

This is what I get when I type sbt:

user@acomputer:~/project/sbt$ sbt
[info] Set current project to default-295917 (in build file:/home/user/project/sbt/)
> 

Thank you for your time.

Upvotes: 0

Views: 263

Answers (2)

andyczerwonka
andyczerwonka

Reputation: 4260

Here's an example of an build.sbt in one of my projects.

organization := "com.andyczerwonka"

name := "esi.intelligence"

version := "0.1"

scalaVersion := "2.9.1"

retrieveManaged := false

logLevel := Level.Info

jettyScanDirs := Nil

seq(webSettings :_*)

temporaryWarPath <<= (sourceDirectory in Compile)(_ / "webapp")

libraryDependencies ++= {
  val liftVersion = "2.4-M4"
    Seq(
  "net.liftweb" %% "lift-webkit" % liftVersion % "compile->default",
      "net.liftweb" %% "lift-mapper" % liftVersion % "compile",
      "org.eclipse.jetty" % "jetty-webapp" % "7.3.0.v20110203" % "provided,jetty",
      "junit" % "junit" % "4.8" % "test",
      "ch.qos.logback" % "logback-classic" % "0.9.26",
      "org.specs2" %% "specs2" % "1.6.1" % "test",
      "net.databinder" %% "dispatch-http" % "0.8.5",
      "com.h2database" % "h2" % "1.2.138"
    )
  }

Notice the 4th line. This tells sbt that I want to use 2.9.1. sbt will bring it down for me and use it.

Upvotes: 1

viktortnk
viktortnk

Reputation: 2757

I'm not experienced sbt user and may only suggest. Seems sbt 0.10.x use scala 2.8.1 itself, so I think sbt console is working by default with this version.

But you can build project with targetting on 2.9.1 by specify scala version in you build.sbt file: `scalaVersion := "2.9.1"' (see https://github.com/harrah/xsbt/wiki/Setup "ConfigureBuild")

And also you can switch scala version used by sbt console by typing "++ 2.9.1" in sbt prompt. (see https://github.com/harrah/xsbt/wiki/Running)

Upvotes: 3

Related Questions