Eran Medan
Eran Medan

Reputation: 45755

How to upgrade Scala to a newer version from the command line?

Is there away to upgrade the installed Scala version via sbt / other command line tool?

I'm sure there is a way, but I couldn't find any after a quick search, am I missing anything?

Upvotes: 12

Views: 25779

Answers (3)

Randall Schulz
Randall Schulz

Reputation: 26486

Each SBT project specifies the version of Scala to use to compile and run its code. It defaults to being the version of Scala that SBT uses internally, but is always overridable.

E.g.

  scalaVersion := "2.10.0"

As Connor Doyle mentioned, if your OS has a package system that includes Scala (some Linux distros I know of do) and you are, for some reason obligated to use that, you are pretty much at their mercy to provide a new version on a timely basis. The Scala Web Site (downloads here) provides a variety of installers and tarballs / Zip archives for every release they've made.

Mac OS X users can use HomeBrew to get up-to-date SBT and Scala.

Upvotes: 12

GatesDA
GatesDA

Reputation: 778

To set the project version temporarily from the command line:

++ 2.10.4

To set the project version permanently from the command line:

set scalaVersion := "2.10.4"
session save

Upvotes: 4

Masashi
Masashi

Reputation: 111

I just executed one command line"homebrew remove scala;homebrew install scala" to update to the latest version. Isn't this enought?

I also found this link (http://wkmacura.tumblr.com/post/11577309978/installing-specific-versions-with-homebrew) and hope it works for you.

Upvotes: 3

Related Questions