Playframwork 2.5创建后无法编译“播放java种子”应用程序

时间:2016-06-14 07:53:52

标签: java playframework playframework-2.5

我正在按照本教程尝试播放框架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

enter image description here

我正在使用:

  1. Windows 7
  2. Java 8
  3. 活化剂 - DIST-1.3.10
  4. 播放2.5.4
  5. 如何解决这个问题?

0 个答案:

没有答案