简体   繁体   中英

How to install library with SBT libraryDependencies in an Intellij project

I am very new to SBT, Breeze and IntelliJ, though I have a decent grasp of Scala and I am trying to install the Breeze library, which I think is managed.

What I've done:

I followed the instructions on this page and added this script to the build.sbt file in my project:

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

I then ran sbt update in the project directory (via the terminal), and saw that all the pieces of Breeze downloaded.

I then tried re-running sbt update , but this did not trigger another download.

Issue:

The problem is that I cannot access the library via IntelliJ. import breeze._ gives the standard Cannot resolve symbol breeze and I couldn't find any mention of Breeze in "Project Structure." It isn't in the lib directory of the project either.

Am I missing a step?

听起来像IntelliJ项目中的一个错误,尝试从项目目录中删除.idea目录,然后使用向导将项目重新导入IntelliJ。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM