Tech TLDR;

  • Archive
  • Top Posts
  • GitHub
  • LinkedIn
  • Contact

How to install old version of SBT using Homebrew

September 15, 2017 by admin

I’ve recently ran into issue where our projects were expecting to run with SBT version 0.13.12, but the only version that was installing with home-brew via brew install sbt was 1.0.1.

Global Setting

I’ve Googled and realized that I can install older version with brew install sbt@0.13 but this installed version 0.13.16 which was still incompatible with our projects.

After few hours of pulling my hair out a co-worker pointed out that I can specify needed sbt version via command line as such: sbt -sbt-version 0.13.12 and it work, but it would be very painful to run it like that every time.

I was thinking of adding an alias, but then I saw something in logs when re-installing sbt one more time.

Global settings should be placed in /usr/local/etc/sbtopts

I’ve opened the /usr/local/etc/sbtopts in editor, uncommented and edited the following:

# Sets the SBT version to use.
-sbt-version  0.13.12
Code language: CSS (css)

After that sbt ran with the needed version, even though I had version 1.0.1 installed.

Local Setting

Another way of setting sbt version (as was suggested in comments) is at project level. To do so:

  1. Edit project/build.properties and add sbt.version=0.13.16 in there.
  2. Run sbt sbtVersion to pick up version from build.properties file.

Filed Under: Scala, Tools

Copyright © 2023 · eleven40 Pro Theme on Genesis Framework · WordPress · Log in