Scala 如何在Intellij项目中安装带有SBT libraryDependencies的库
我对SBT、Breeze和IntelliJ非常陌生,尽管我对Scala有相当的了解,我正在尝试安装Breeze库,我认为它是可以管理的 我所做的: 我按照上的说明将此脚本添加到项目中的Scala 如何在Intellij项目中安装带有SBT libraryDependencies的库,scala,intellij-idea,sbt,scala-breeze,Scala,Intellij Idea,Sbt,Scala Breeze,我对SBT、Breeze和IntelliJ非常陌生,尽管我对Scala有相当的了解,我正在尝试安装Breeze库,我认为它是可以管理的 我所做的: 我按照上的说明将此脚本添加到项目中的build.sbt文件中: libraryDependencies ++= Seq( // other dependencies here "org.scalanlp" %% "breeze" % "0.10", // native libr
build.sbt
文件中:
libraryDependencies ++= Seq(
// other dependencies here
"org.scalanlp" %% "breeze" % "0.10",
// native libraries are not included by default. add this if you want them (as of 0.7)
// native libraries greatly improve performance, but increase jar sizes.
"org.scalanlp" %% "breeze-natives" % "0.10"
)
resolvers ++= Seq(
// other resolvers here
"Sonatype Releases" at "https://oss.sonatype.org/content/repositories/releases/"
)
// Scala 2.9.2 is still supported for 0.2.1, but is dropped afterwards.
scalaVersion := "2.11.1" // or 2.10.3 or later
然后我在项目目录中运行了sbt update
(通过终端),看到所有的Breeze文件都已下载
然后我尝试重新运行sbt update
,但这并没有触发另一次下载
问题:
问题是我无法通过IntelliJ访问库<代码>导入breeze.\u给出了标准的无法解析符号breeze
,我在“项目结构”中找不到任何关于breeze的内容。它也不在项目的lib目录中
我是否缺少一个步骤?听起来像IntelliJ项目中的一个bug,请尝试从项目目录中删除
.idea
目录,然后使用向导将项目重新导入IntelliJ。当您第一次打开项目时,IntelliJ中是“自动导入”票证?如果不是的话,它可能值得从IntelliJ的主菜单重新导入,因为它非常奇怪。我似乎无法将其切换为打开。。。它实际上没有反应。我尝试重新启动它,但仍然没有结果。从项目目录中删除.idea文件夹,然后从头开始尝试。对,我找到了另一种方法设置>构建、执行、部署>SBT>使用自动导入,但这并没有解决问题。如果在终端中运行“SBT编译”,是否成功?是否只是IntelliJ导致了问题?…并在导入向导中选择“从现有项目模型导入->SBT”。。。