gpt4 book ai didi

playframework-2.0 - 无法访问 Play Framework 中的应用程序

转载 作者:行者123 更新时间:2023-12-01 10:06:37 26 4
gpt4 key购买 nike

您好,我安装了新版本的 play framework 2.0。现在我正在尝试连接到教程中的示例应用程序,但似乎无法正常工作。这是我所做的:

创建“todolist”应用程序:


play new todolist



<p>play! 2.0, <a href="http://www.playframework.org" rel="noreferrer noopener nofollow">http://www.playframework.org</a></p>

<p>The new application will be created in /home/evermean/Code/playWorkspace/todolist</p>

<p>What is the application name?<br/><br/>
>todolist</p>

<p>Which template do you want to use for this new application? </p>

<p>1 - Create a simple Scala application<br/>
2 - Create a simple Java application<br/>
3 - Create an empty project<br/></p>

<p>> 2</p>

OK, application todolist is created.
Have fun!

执行 Play 命令:



<p>$ cd todolist <br/>
$ play<br/></p>

<p>Getting org.scala-tools.sbt sbt_2.9.1 0.11.2 ...<br/>
:: retrieving :: org.scala-tools.sbt#boot-app<br/>
confs: [default]<br/>
37 artifacts copied, 0 already retrieved (7324kB/127ms)
[info] Loading project definition from /home/evermean/Code/playWorkspace/todolist/project<br/>
[info] Set current project to todolist (in build file:/home/evermean/Code/playWorkspace/todolist/)<br/></p>

<p>play! 2.0, <a href="http://www.playframework.org" rel="noreferrer noopener nofollow">http://www.playframework.org</a></p>

> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.

执行运行命令:


[todolist] $ run



<p>[info] Updating {file:/home/evermean/Code/playWorkspace/todolist/}todolist...
[info] Done updating.<br/>
--- (Running the application from SBT, auto-reloading is enabled) ---</p>

<p>[info] play - Listening for HTTP on port 9000...</p>

<p>(Server started, use Ctrl+D to stop and go back to the console...)</p>

<p><strong>Now I try to connect to the site <a href="http://localhost:9000" rel="noreferrer noopener nofollow">http://localhost:9000</a></strong></p>

<p>I get the following output:</p>


[info] Compiling 4 Scala sources and 2 Java sources to /home/evermean/Code/playWorkspace/todolist/target/scala-2.9.1/classes...<br/><br/>
[warn] Problem processing dependencies of source /home/evermean/Code/playWorkspace/todolist/app/controllers/Application.java : java.lang.UnsupportedClassVersionError: controllers/Application : Unsupported major.minor version 51.0<br/><br/>
[warn] Error reading API from class file : java.lang.UnsupportedClassVersionError: controllers/Application : Unsupported major.minor version 51.0<br/><br/>
[warn] Problem processing dependencies of source /home/evermean/Code/playWorkspace/todolist/target/scala-2.9.1/src_managed/main/controllers/routes.java : java.lang.UnsupportedClassVersionError: controllers/routes : Unsupported major.minor version 51.0<br/><br/>
[warn] Problem processing dependencies of source /home/evermean/Code/playWorkspace/todolist/target/scala-2.9.1/src_managed/main/controllers/routes.java : java.lang.UnsupportedClassVersionError: controllers/routes$ref : Unsupported major.minor version 51.0<br/><br/>
[warn] Problem processing dependencies of source /home/evermean/Code/playWorkspace/todolist/target/scala-2.9.1/src_managed/main/controllers/routes.java : java.lang.UnsupportedClassVersionError: controllers/routes$javascript : Unsupported major.minor version 51.0<br/><br/>
[warn] Problem processing dependencies of source /home/evermean/Code/playWorkspace/todolist/target/scala-2.9.1/src_managed/main/controllers/routes.java : java.lang.UnsupportedClassVersionError: controllers/routes : Unsupported major.minor version 51.0<br/><br/>
[warn] Problem processing dependencies of source /home/evermean/Code/playWorkspace/todolist/target/scala-2.9.1/src_managed/main/controllers/routes.java : java.lang.UnsupportedClassVersionError: controllers/routes$ref : Unsupported major.minor version 51.0<br/><br/>
[warn] Problem processing dependencies of source /home/evermean/Code/playWorkspace/todolist/target/scala-2.9.1/src_managed/main/controllers/routes.java : java.lang.UnsupportedClassVersionError: controllers/routes : Unsupported major.minor version 51.0<br/><br/>
[warn] Problem processing dependencies of source /home/evermean/Code/playWorkspace/todolist/target/scala-2.9.1/src_managed/main/controllers/routes.java : java.lang.UnsupportedClassVersionError: controllers/routes$javascript : Unsupported major.minor version 51.0<br/><br/>
[warn] Error reading API from class file : java.lang.UnsupportedClassVersionError: controllers/routes : Unsupported major.minor version 51.0<br/><br/>
[warn] Error reading API from class file : java.lang.UnsupportedClassVersionError: controllers/routes$ref : Unsupported major.minor version 51.0
[warn] Error reading API from class file : java.lang.UnsupportedClassVersionError: controllers/routes$javascript : Unsupported major.minor version 51.0<br/><br/>
[info] play - Application started (Dev)

我真的不知道该怎么做,也许有人对此有想法。我想我做错了什么,但看不出我的错误在哪里。我希望有人能提供帮助。

谢谢...

最佳答案

看起来您使用的 JDK 太旧了。您使用的是哪个版本的 Java?

关于playframework-2.0 - 无法访问 Play Framework 中的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9759872/

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