zoukankan      html  css  js  c++  java
  • Windows下sbt安装配置

    1.下载sbt1.2.8

    官网:https://sbt-downloads.cdnedge.bluemix.net/releases/v1.2.8/sbt-1.2.8.tgz

    2.配置环境

    #SBT_HOME设置为sbt解压目录,例如:

    SBT_HOME=C:Programssbt;

    #在path中添加:

    Path=%SBT_HOME%in;

    3.sbt配置

    在sbtconfsbtconfig.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.设置阿里云镜像

    国内的网络环境复杂,阿里云还挺好用的,在sbtconf下新建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:UsersPetterChen>sbt
    "C:UsersPetterChen.sbtpreloadedorg.scala-sbtsbt"1.0.3"jarssbt.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:UsersPetterChenproject
    [info] Set current project to petterchen (in build file:/C:/Users/PetterChen/)
    [info] sbt server started at 127.0.0.1:4729
    sbt:petterchen>

    注意,第一次运行的时候,sbt需要下载一些东西,下载消耗时间看网络情况状态。sbt版本不同的话,最后的结果也可能不一样,但是只要配置和网络正常,最后都会进入sbt的控制台。

    参考:

    https://blog.csdn.net/qq_21383435/article/details/79970850

  • 相关阅读:
    第十三周助教总结
    C语言I博客作业09
    第十二周助教总结
    C语言I博客作业08
    第十一周助教总结
    C语言I博客作业07
    C语言I博客作业06
    C语言I博客作业05
    C语言I作业07
    C语言I作业06
  • 原文地址:https://www.cnblogs.com/lenmom/p/10364078.html
Copyright © 2011-2022 走看看