播放编译错误:无法访问Function0

时间:2016-11-23 16:38:55

标签: scala intellij-idea playframework playframework-2.0

我刚刚使用向导在IntelliJ IDEA 2016.3中创建了一个新的Play项目,如下所述:

https://www.jetbrains.com/help/idea/2016.2/getting-started-with-play-2-x.html#create_project

IntelliJ不会报告任何错误,重建也会成功而不会出错。甚至“sbt run”启动服务器也没有问题。但是当我在浏览器中打开http://localhost:9000时,我看到了:

[info] Compiling 7 Scala sources and 1 Java source to C:\vyvoj\play5\target\scala-2.11\classes...
[error] C:\vyvoj\play5\target\scala-2.11\routes\main\controllers\routes.java:12: error: cannot access Function0
[error]   public static final controllers.ReverseAssets Assets = new controllers.ReverseAssets(RoutesPrefix.byNamePrefix());
[error]                                                          ^
[error]   class file for scala.Function0 not found
[error] 1 error
[error] (compile:compile) javac returned nonzero exit code
[error] application -

也许java编译器看不到scala库,但为什么?

谢谢, 帕维尔

1 个答案:

答案 0 :(得分:0)

我通过在project / build.properties中将sbt.version更新为0.13.13来解决这个问题(它是0.13.5)。