在Windows 10上的Scala课程中安装SBT [英] Installing sbt on Windows 10 for Scala course

查看:331
本文介绍了在Windows 10上的Scala课程中安装SBT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该课程的说明说要使用Verion0.13.x. 我从sbt站点安装了最新的msi,但是当我键入"sbt about"时,我得到:

Instructions for the course say to use verion 0.13.x. I installed the latest msi from the sbt site, but when I type "sbt about", I get:

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.

i.e., a jar file error and the sbt version 1.0.2.

知道我在做什么错吗?

推荐答案

您没有做错任何事情,只是所需的版本0.13.x不再是最新版本.因此,您可以按照@ dmytro-mitin的回答并重新安装sbt,或者仍然可以使用已经拥有的计算机:现在安装的是

You are not doing anything wrong, it's just that the required version 0.13.x is not the latest anymore. So you can either follow @dmytro-mitin's answer and reinstall sbt, or you can still use the one you already have: what you installed now is the sbt launcher, it can be used to run different versions of sbt depending on a project. So it's not important which launcher version you are using (unless you're working on something very sbt-specific).

通常,每个sbt项目都有一个project/build.properties文件,该文件需要使用sbt版本:

Normally, every sbt project has a project/build.properties file with the sbt version that is needed to work with it:

sbt.version=0.13.16

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

So you can change (or create) this file and when you run sbt in the project root folder, it will launch sbt version 0.13.16.

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

Another way to launch specific version of sbt is to run it with the -sbt-version option :

sbt -sbt-version 0.13.16

或使用-D标志:

sbt -Dsbt.version=0.13.16

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

which has exactly the same effect as editing project/build.properties.

这篇关于在Windows 10上的Scala课程中安装SBT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆