user3788749
user3788749

Reputation: 11

Installing sbt on Windows 10 for Scala course

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

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

Any idea what I'm doing wrong?

Upvotes: 0

Views: 4709

Answers (2)

laughedelic
laughedelic

Reputation: 6460

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).

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

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.

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

sbt -sbt-version 0.13.16

or using -D flag:

sbt -Dsbt.version=0.13.16

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

Upvotes: 1

Dmytro Mitin
Dmytro Mitin

Reputation: 51693

Install not the latest version. The latest one is 1.0.2.

Install 0.13.16.

You can download it here: http://www.scala-sbt.org/download.html

There are msi and zip files.

Installing sbt on Windows

Upvotes: 0

Related Questions