gpt4 book ai didi

java - Play Framework - 新项目中不存在包

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:03:28 25 4
gpt4 key购买 nike

我正在尝试编译新创建的 Play Framework 应用程序。我按照说明使用 play-java 模板生成了应用程序并将其命名为测试。我导航到“测试”目录,再次运行 activator.bat 并键入“编译”。这显示:

Z:\aaa\activator-1.2.10\test>activator.bat
[info] Loading project definition from Z:\aaa\activator-1.2.10\test\project
[info] Set current project to test (in build file:/Z:/aaa/activator-1.2.10/test/)
[test] $ compile
[info] Compiling 4 Scala sources and 2 Java sources to Z:\aaa\activator-1.2.10\test\target\scala-2.11\classes...
[error] Z:\aaa\activator-1.2.10\test\app\controllers\Application.java:3: error: package play does not exist
[error] import play.*;
[error] ^
[error] Z:\aaa\activator-1.2.10\test\app\controllers\Application.java:4: error: package play.mvc does not exist
[error] import play.mvc.*;
[error] ^
[error] Z:\aaa\activator-1.2.10\test\app\controllers\Application.java:8: error: cannot find symbol
[error] public class Application extends Controller {
[error] ^
[error] symbol: class Controller
[error] Z:\aaa\activator-1.2.10\test\app\controllers\Application.java:10: error: cannot find symbol
[error] public static Result index() {
[error] ^
[error] symbol: class Result
[error] location: class Application
[error] Z:\aaa\activator-1.2.10\test\target\scala-2.11\classes\controllers\ReverseAssets.class: warning: Cannot find annotation method 'bytes()' in type 'ScalaS
ignature': class file for scala.reflect.ScalaSignature not found
[error] Z:\aaa\activator-1.2.10\test\target\scala-2.11\classes\controllers\ReverseApplication.class: warning: Cannot find annotation method 'bytes()' in type 'S
calaSignature'
[error] Z:\aaa\activator-1.2.10\test\target\scala-2.11\classes\controllers\javascript\ReverseAssets.class: warning: Cannot find annotation method 'bytes()' in t
ype 'ScalaSignature'
[error] Z:\aaa\activator-1.2.10\test\target\scala-2.11\classes\controllers\javascript\ReverseApplication.class: warning: Cannot find annotation method 'bytes()'
in type 'ScalaSignature'
[error] Z:\aaa\activator-1.2.10\test\target\scala-2.11\classes\controllers\ref\ReverseAssets.class: warning: Cannot find annotation method 'bytes()' in type 'Sc
alaSignature'
[error] Z:\aaa\activator-1.2.10\test\target\scala-2.11\classes\controllers\ref\ReverseApplication.class: warning: Cannot find annotation method 'bytes()' in typ
e 'ScalaSignature'
[error] Z:\aaa\activator-1.2.10\test\target\scala-2.11\classes\views\html\index.class: warning: Cannot find annotation method 'bytes()' in type 'ScalaSignature'

[error] Z:\aaa\activator-1.2.10\test\app\controllers\Application.java:11: error: cannot access Html
[error] return ok(index.render("Your new application is ready."));
[error] ^
[error] class file for play.twirl.api.Html not found
[error] 5 errors
[error] 7 warnings
[error] (compile:compile) javac returned nonzero exit code
[error] Total time: 7 s, completed 2014-08-24 17:29:48

我使用的是 Windows 8。提前致谢。

编辑:我成功地运行了 2.2,没有任何问题,只有 2.3 没有 Play 。*

最佳答案

您不必转到子目录。

Activator 或 SBT 应该从 build.sbt 文件所在的目录运行(这是包含 apptest 子目录的父目录) .

一旦 Activator/SBT 像那样启动,就可以使用任务 test 编译和执行测试。

关于java - Play Framework - 新项目中不存在包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25473318/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com