我正在按照本教程尝试播放框架2.5.4:
https://www.playframework.com/documentation/2.5.x/Installing
我使用“Play Scala Seed”模板创建了一个应用程序,它运行正常。
但是当我从“Play Java Seed”模板创建一个应用程序时,它无法编译。
我尝试阅读错误消息,但我没有提示解决此问题。
这是详细错误消息:
Read from stdout: Compiling 6 Scala sources and 10 Java sources to D:\thanhpt\self-study\play framework\play-java\target\scala-2.11\classes...
Compiling 6 Scala sources and 10 Java sources to D:\thanhpt\self-study\play framework\play-java\target\scala-2.11\classes...
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\controllers\AsyncController.java:47: error: ')' expected
D:\thanhpt\self-study\play framework\play-java\app\controllers\AsyncController.java:47: error: ')' expected
Read from stdout: return getFutureMessage(1, TimeUnit.SECONDS).thenApplyAsync(Results::ok, exec);
Read from stdout: ^
return getFutureMessage(1, TimeUnit.SECONDS).thenApplyAsync(Results::ok, exec);
^
D:\thanhpt\self-study\play framework\play-java\app\controllers\AsyncController.java:47: error: illegal start of expression
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\controllers\AsyncController.java:47: error: illegal start of expression
Read from stdout: return getFutureMessage(1, TimeUnit.SECONDS).thenApplyAsync(Results::ok, exec);
Read from stdout: ^
return getFutureMessage(1, TimeUnit.SECONDS).thenApplyAsync(Results::ok, exec);
^
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\controllers\AsyncController.java:47: error: ';' expected
D:\thanhpt\self-study\play framework\play-java\app\controllers\AsyncController.java:47: error: ';' expected
Read from stdout: return getFutureMessage(1, TimeUnit.SECONDS).thenApplyAsync(Results::ok, exec);
Read from stdout: ^
return getFutureMessage(1, TimeUnit.SECONDS).thenApplyAsync(Results::ok, exec);
^
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\controllers\AsyncController.java:54: error: illegal start of expression
D:\thanhpt\self-study\play framework\play-java\app\controllers\AsyncController.java:54: error: illegal start of expression
Read from stdout: () -> future.complete("Hi!"),
Read from stdout: ^
() -> future.complete("Hi!"),
^
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\controllers\AsyncController.java:54: error: illegal start of expression
D:\thanhpt\self-study\play framework\play-java\app\controllers\AsyncController.java:54: error: illegal start of expression
Read from stdout: () -> future.complete("Hi!"),
Read from stdout: ^
() -> future.complete("Hi!"),
^
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\filters\ExampleFilter.java:40: error: illegal start of expression
D:\thanhpt\self-study\play framework\play-java\app\filters\ExampleFilter.java:40: error: illegal start of expression
Read from stdout: result -> result.withHeader("X-ExampleFilter", "foo"),
Read from stdout: ^
result -> result.withHeader("X-ExampleFilter", "foo"),
^
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:42: error: illegal start of expression
D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:42: error: illegal start of expression
Read from stdout: appLifecycle.addStopHook(() -> {
Read from stdout: ^
appLifecycle.addStopHook(() -> {
^
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:42: error: illegal start of expression
D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:42: error: illegal start of expression
Read from stdout: appLifecycle.addStopHook(() -> {
Read from stdout: ^
appLifecycle.addStopHook(() -> {
^
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:42: error: illegal start of expression
D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:42: error: illegal start of expression
Read from stdout: appLifecycle.addStopHook(() -> {
Read from stdout: ^
appLifecycle.addStopHook(() -> {
^
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:42: error: ';' expected
D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:42: error: ';' expected
Read from stdout: appLifecycle.addStopHook(() -> {
Read from stdout: ^
appLifecycle.addStopHook(() -> {
^
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:47: error: illegal start of type
D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:47: error: illegal start of type
Read from stdout: });
Read from stdout: ^
});
^
Read from stdout: D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:50: error: class, interface, or enum expected
D:\thanhpt\self-study\play framework\play-java\app\services\ApplicationTimer.java:50: error: class, interface, or enum expected
Read from stdout: }
Read from stdout: ^
}
^
Read from stdout: (compile:compileIncremental) javac returned nonzero exit code
(compile:compileIncremental) javac returned nonzero exit code
Total time: 2 s, completed Jun 14, 2016 2:34:23 PM
我正在使用:
如何解决这个问题?