【问题标题】:Installing sbt on Windows 10 for Scala course在 Windows 10 上安装 sbt for Scala 课程
【发布时间】:2017-11-06 10:51:12
【问题描述】:

课程说明说使用版本 0.13.x。 我从 sbt 站点安装了最新的 msi,但是当我输入“sbt about”时,我得到:

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\reall>sbt about
Error: Unable to access jarfile
Copying runtime jar.
The filename, directory name, or volume label syntax is incorrect.
Error: Unable to access jarfile
"C:\Users\reall\.sbt\preloaded\org.scala-sbt\sbt\"1.0.2"\jars\sbt.jar"
Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
[info] Loading project definition from C:\Users\reall\project
[info] Set current project to reall (in build file:/C:/Users/reall/)
[info] This is sbt 1.0.2
[info] The current project is {file:/C:/Users/reall/}reall 0.1-SNAPSHOT
[info] The current project is built against Scala 2.12.3
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.12.3

即 jar 文件错误和 sbt 版本 1.0.2。

知道我做错了什么吗?

【问题讨论】:

    标签: scala sbt installation


    【解决方案1】:

    您没有做错任何事情,只是所需的版本0.13.x 不再是最新的。所以你可以按照@dmytro-mitin的回答重新安装sbt,或者你仍然可以使用你已经拥有的:你现在安装的是sbt launcher,它可以用来运行不同的版本sbt 取决于项目。因此,您使用哪个启动器版本并不重要(除非您正在处理非常特定于 sbt 的东西)。

    通常,每个 sbt 项目都有一个 project/build.properties 文件,其中包含使用它所需的 sbt 版本:

    sbt.version=0.13.16
    

    因此您可以更改(或创建)此文件,当您在项目根文件夹中运行 sbt 时,它将启动 sbt 版本 0.13.16。

    启动特定版本 sbt 的另一种方法是使用 -sbt-version 选项运行它:

    sbt -sbt-version 0.13.16
    

    或使用-D 标志:

    sbt -Dsbt.version=0.13.16
    

    与编辑project/build.properties的效果完全相同。

    【讨论】:

      【解决方案2】:

      安装不是最新版本。最新的是 1.0.2。

      安装 0.13.16。

      你可以在这里下载:http://www.scala-sbt.org/download.html

      msizip 文件。

      Installing sbt on Windows

      【讨论】:

        猜你喜欢
        • 2016-10-18
        • 1970-01-01
        • 2021-08-23
        • 2022-06-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多