I need sbt version 0.13.x for a course in Scala and I am having difficulties installing it. I tried with the brew install [email protected] command, but when I then check with sbt about it gives a message No such file or directory.
However, if I again try and do brew install [email protected], it gives Warning: [email protected] 0.13.16 is already installed, although sbt about does not find anything.
In addition to that, I tried installing the latest version of sbt with brew install sbt and then manually changing the version each of my projects is using by entering sbt.version=0.13.12 in a given build.properties file. This seemed to work initially, when I check with the terminal the version of sbt inside the project. However, I am still not able to import already existing projects.
Finally, I downloaded the version from http://www.scala-sbt.org/download.html but then I need to do some corrections to my PATH from what I've read online and I am not sure what that means.
So, I would be grateful if someone could help me with the installation of an older version.
The way
sbtworks is that it will look inproject/build.propertiesfor thesbtversion to use to build your project. So the way you described - installing the latestsbtand set the version you want to use for the build inproject/build.properties- should work just fine. Regardingthese existing projects also should have
project/build.propertiesindicating the sbt version.Note that even with installing 0.13.12 locally, when building your project
sbtwill still use the version specified inproject/build.properties, it will just download it as necessary.If you absolutely want to run a specific version from the command line, as you already discovered, you can download it. Regarding updating your
PATH-PATHis an environment variable that tells your command line where to look for executable files. It's a list of directories, so if you unpacked the downloaded file in say "$HOME/tools", you have so say something likeexport PATH=$HOME/tools/sbt/bin:$PATH. See https://www.cyberciti.biz/faq/appleosx-bash-unix-change-set-path-environment-variable/ for a more detailed description.