0
我剛剛創建了一個新的遊戲項目的IntelliJ IDEA 2016.3使用嚮導如下所述:玩編譯錯誤:無法訪問Function0
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的庫,但爲什麼呢?
感謝, 帕維爾