Hi新手到sbt我已经安装sbt表单在这里https://www.scala-sbt.org/download.html (windows sbt-1.0.4.msi),然后我做sbt about它产生
C:\Users\rajnish.kumar>sbt about
"C:\Users\rajnish.kumar\.sbt\preloaded\org.scala-sbt\sbt\"1.0.4"\jars\sbt.jar"
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[warn] Executing in batch mode.
[warn] For better performance, hit [ENTER] to switch to interactive mode, or
[warn] consider launching sbt without any commands, or explicitly passing 'shell'
[info] Loading project definition from C:\Users\rajnish.kumar\project
[info] Set current project to rajnish-kumar (in build file:/C:/Users/rajnish.kumar/)
[info] This is sbt 0.13.15
[info] The current project is {file:/C:/Users/rajnish.kumar/}rajnish-kumar 0.1-SNAPSHOT
[info] The current project is built against Scala 2.10.6
[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.10.6问题是为什么它打印的是sbt版本0.13.15而不是1.0.4?我用的是windows8。
hi在Windows10上尝试了同样的方法,并获得了预期的结果
C:\Users\rajnish>sbt about
"C:\Users\rajnish\.sbt\preloaded\org.scala-sbt\sbt\"1.0.4"\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\rajnish\project
[info] Set current project to rajnish (in build file:/C:/Users/rajnish/)
[info] This is sbt 1.0.4
[info] The current project is {file:/C:/Users/rajnish/}rajnish 0.1-SNAPSHOT
[info] The current project is built against Scala 2.12.4
[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.4发布于 2017-12-14 21:03:22
为了在构建项目时真正执行SBT版本,您应该在project/build.properties文件中指定此版本。以下是我的项目中此文件的内容:
sbt.version = 1.0.4如果我导航到根项目文件夹并运行sbt about,它会显示
[info] This is sbt 1.0.4
[info] The current project is {file:/ssd2/projects/ADMP/}admp 1.0
[info] The current project is built against Scala 2.11.9如果我将build.properties中的版本更改为
sbt.version = 1.0.1然后运行sbt about,它显示给我
[info] This is sbt 1.0.1
[info] The current project is {file:/ssd2/projects/ADMP/}admp 1.0
[info] The current project is built against Scala 2.11.9SBT知道如何加载特定版本的源代码,如果当前版本的SBT不同,则加载它们,编译该版本的SBT,然后使用该版本的SBT构建您的项目。
为什么在你的情况下默认显示0.13.15 -我不确定。可能在您的项目中,您在build.properties中指定了该版本,可能是出于某些其他原因。
也可以尝试使用sbtVersion任务的帮助进行检查。运行命令sbt sbtVersion。
发布于 2018-02-12 23:33:59
对我来说,它的安装并不是很干净。为了解决这个问题,我已经完成了以下步骤:
https://stackoverflow.com/questions/47806732
复制相似问题