Windows下安裝配置SBT

1.下載sbt
官網:http://www.scala-sbt.org/download.html
CSDN:http://download.csdn.net/download/u014532217/10187174
2.配置環境
#SBT_HOME設置爲sbt解壓目錄,例如:

SBT_HOME=C:\Programs\sbt;
#在path中添加:

Path=%SBT_HOME%\bin;
3.sbt配置
在sbt\conf\sbtconfig.txt中末尾添加

-Dsbt.boot.directory=C:/Programs/sbt/data/.sbt/boot
-Dsbt.global.base=C:/Programs/sbt/data/.sbt
-Dsbt.ivy.home=C:/Programs/sbt/data/.ivy2
-Dsbt.repository.config=C:/Programs/sbt/conf/repo.properties
-Dsbt.repository.secure=false

# 設置代理
# -Dhttp.proxyHost=10.18.11.11
# -Dhttp.proxyPort=8080
# -Dhttp.proxyUser=xx
# -Dhttp.proxyPassword=xx

# -Dhttps.proxyHost=10.18.1111
# -Dhttps.proxyPort=8080
# -Dhttps.proxyUser=xx
# -Dhttps.proxyPassword=xx

如果有需要設置代理的話,將“#設置代理”下面的#號去掉,並添加相應的代理設置,#是註釋。

4.設置阿里雲鏡像
國內的網絡環境複雜,阿里雲還挺好用的,在sbt\conf\下新建repo.properties文件,內容爲:

[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

5.驗證
打開cmd,輸入sbt,如果出現類似下面的結果則表明安裝成功:

C:\Users\PetterChen>sbt
"C:\Users\PetterChen\.sbt\preloaded\org.scala-sbt\sbt\"1.0.3"\jars\sbt.jar"
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from C:\Users\PetterChen\project
[info] Set current project to petterchen (in build file:/C:/Users/PetterChen/)
[info] sbt server started at 127.0.0.1:4729
sbt:petterchen>
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章