Get上的Play出错:java.lang.UnsupportedClassVersionError:controllers / routes:不支持的major.minor>版本

时间:2013-07-12 06:35:12

标签: java playframework-2.0

我最近安装了Java 1.6并播放2.10.0。当尝试在播放框架上运行骨架Web应用程序时,我在页面请求时收到此错误。

play.api.Application$$anon$1: Execution exception[[RuntimeException: java.lang.UnsupportedClassVersionError: controllers/routes : Unsupported major.minor version 51.0]]

我已经阅读了关于不受支持的major.minor错误的play框架线程,并根据我能理解的内容采取了行动。下载并安装java版本1.6(我一直使用1.7)后,我的环境如下所示,我仍然收到相同的错误。如何超越此错误?

java  1.6.0_33

javac 1.6.0_45

播放2.1.2(使用Java 1.6.0_33和Scala 2.10.0)

路径:

C:\Program Files (x86)\Silverfrost\FTN95;C:\Program Files (x86)\Silverfrost\FTN95\FTN95 for Microsoft Visual >Studio;C:\Users\zach\nodejs;C:\Users\zach\AppData\Roaming\npm;C:\Users\zach\NodeApps;C:\Users\zach\Downloads\play-2.1.2\play-2.1.2;C:\Program Files\Java\jdk1.6.0_45\bin;

我收到的错误如下......

异常...

2013-07-12 00:53:00,472 - [INFO] - from play in play-internal-execution-context-1 
Application started (Dev)

2013-07-12 00:53:00,781 - [ERROR] - from application in play-internal-execution-context-3 


! @6f0e5c888 - Internal server error, for (GET) [/] ->

play.api.Application$$anon$1: Execution exception[[RuntimeException: java.lang.UnsupportedClassVersionError: controllers/routes : Unsupported major.minor version 51.0]]
    at play.api.Application$class.handleError(Application.scala:289) ~[play_2.10.jar:2.1.2]
    at play.api.DefaultApplication.handleError(Application.scala:383) [play_2.10.jar:2.1.2]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$18$$anonfun$apply$18.apply(PlayDefaultUpstreamHandler.scala:310) [play_2.10.jar:2.1.2]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$18$$anonfun$apply$18.apply(PlayDefaultUpstreamHandler.scala:308) [play_2.10.jar:2.1.2]

1 个答案:

答案 0 :(得分:7)

我无法在JDK 1.7下的JDK1.6环境下重新编译我的Play / Scala应用程序。向JDK1.6下行版本并在JDK 1.6环境中吹掉/重新创建我的Play / Scala项目解决了这些错误。