I installed SBT v0.12.4. Now I want to update it to v0.13.x, so I have used the command
brew install sbt
It says that it has correctly installed SBT 0.13.x. but if I ask on terminal the version of SBT, it says 0.12.4. How to update it?
There are two sbt versions:
The sbt-launcher
. This is used to download and run a particular sbt version. This is what you installed with brew. If you type sbt --version
it should tell you the version of the launcher brew installed.
sbt itself (for building projects). This is controlled via a project/build.properties
file by project. So one launcher can launch many versions of sbt, and is generally backwards compatible. To update this version, simple change the sbt.version
property in project/build.properties
.
build.properties
because android studio doesn't show mw up this file, I've to manually enter with finder on the folder.
Commented
Nov 3, 2014 at 15:38
sbt --version
does not work for me currently, (running 0.13.12 btw), but I need to run sbt sbt-version
to get the version information.
Commented
Oct 20, 2017 at 3:27
sbt sbt-version
didn't work for me - sbt sbtVersion
did though.
Commented
Jan 15, 2020 at 10:28
If you want to upgrade the version of sbt installed by homebrew, use:
brew upgrade sbt
You can check what version of sbt is in use with sbt about
There is an alternative sbt-launcher
with source code here paulp/sbt-extras that allows specifying sbt version within command line.
Installing sbtx
brew install --HEAD paulp/extras/sbtx
Or
curl -Ls https://git.io/sbt > ~/bin/sbt && chmod 0755 ~/bin/sbt
Building project with desired sbt version
sbt -sbt-version 1.2.5 clean test
ls -l /usr/local/bin/sbt
andls -l /usr/local/Cellar/sbt*
?