IntelliJ和Play框架:“`scala-library`已破坏源路径”

时间:2014-10-16 05:11:21

标签: java scala maven intellij-idea playframework

由于scala-library-src.jar下缺少SCALA_HOME/lib文件,我无法在IntelliJ中解析Scala库。

在我的Project Structure>下Project Settings> Libraries> scala-library我有以下错误:

Library 'scala-library' has broken sources path:
/home/lucas/Applications/scala-2.11.2/lib/scala-library-src.jar

我的SCALA_HOME = /home/lucas/Applications/scala-2.11.2/。错误是有道理的,因为我scala-library-src.jar下没有/home/lucas/Applications/scala-2.11.2/lib/,尽管我似乎有Scala库的其余部分:

[lucas]/home/.../Applications$ ls scala-2.11.2/lib/
akka-actor_2.11-2.3.4.jar              scala-continuations-library_2.11-1.0.2.jar
ant                                    scala-continuations-plugin_2.11.2-1.0.2.jar
config-1.2.1.jar                       scala-library.jar
forkjoin.jar.desired.sha1              scalap-2.11.2.jar
jline-2.12.jar                         scala-parser-combinators_2.11-1.0.2.jar
scala-actors-2.11.0.jar                scala-reflect.jar
scala-actors-migration_2.11-1.1.0.jar  scala-swing_2.11-1.0.1.jar
scala-compiler.jar                     scala-xml_2.11-1.0.2.jar
[lucas-ThinkPad-W520]/home/.../Applications$ 

我在哪里可以找到适合我的Scala库或适当的scala-library-src.jar?我从here下载了Scala。

背景 我正在关注this Play Framework tutorial,并且在使用routes.java下的文件target > scala-2.11 > src_managed > main > controllers > routes.java时,我在时间30:10左右点击了错误:

// @SOURCE:/home/lucas/Dropbox/projects/mapApp/foobar/conf/routes
// @HASH:85b050b64020786e36ab0f298ee833d94c0ac5cf
// @DATE:Wed Oct 15 18:47:03 PDT 2014

package controllers;

public class routes {
public static final controllers.ReverseAssets Assets = new controllers.ReverseAssets();
public static final controllers.ReverseApplication Application = new controllers.ReverseApplication();

public static class javascript {
public static final controllers.javascript.ReverseAssets Assets = new controllers.javascript.ReverseAssets();
public static final controllers.javascript.ReverseApplication Application = new controllers.javascript.ReverseApplication();
}


public static class ref {
public static final controllers.ref.ReverseAssets Assets = new controllers.ref.ReverseAssets();
public static final controllers.ref.ReverseApplication Application = new controllers.ref.ReverseApplication();
}

}

controllerscontrollers.javascriptcontrollers.ref之后的所有内容都是未解析的符号。

我在IntelliJ上运行Ubuntu 14.04。

2 个答案:

答案 0 :(得分:1)

在我看来,找到图书馆,资源和javadocs的最简单的地方是Maven Central


如果你使用sbt-idea插件,你可以让sbt生成你的项目文件,这将自动包含一个包含源和文档的完整Scala方面。

答案 1 :(得分:0)

如果在项目中运行激活器,请键入clean然后编译。