目录
https://github.com/sbt/sbt/releases/download/v1.7.2/sbt-1.7.2.zip
解压 sbt-1.7.2.zip 到 D:\Program Files\sbt

设置系统环境变量SBT_HOME为sbt安装目录:SBT_HOME=D:\Program Files\sbt;
在path中添加:Path=%SBT_HOME%\bin
在conf目录下sbtconfig.txt文件末尾添加以下内容:
- -Dsbt.log.format=true
- -Dfile.encoding=UTF8
- -Dsbt.global.base=e:/sbt/.sbt
- -Dsbt.boot.directory=e:/sbt/.sbt/boot/
- -Dsbt.repository.config=e:/sbt/.sbt/repo.properties
- -Dsbt.ivy.home=e:/sbt/.ivy2
- -Dsbt.override.build.repos=true
- -Xmx512M
- -Xss2M
- -XX:+CMSClassUnloadingEnabled
将conf目录下的repo.properties复制到上面的指定目录,我复制到E:/sbt/.sbt/目录下,内容为:
- [repositories]
- local
- aliyun: http://maven.aliyun.com/nexus/content/groups/public/
- typesafe: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
- sonatype-oss-releases
- maven-central
- sonatype-oss-snapshots
打开cmd,输入sbt,如果出现类似下面的结果则表明安装成功:
注意,第一次运行的时候,sbt需要下载一些东西,下载消耗时间看网络情况状态。sbt版本不同的话,最后的结果也可能不一样,但是只要配置和网络正常,最后都会进入sbt的控制台。