无法导出播放! app作为战争

时间:2011-10-03 03:34:52

标签: playframework java-7

我正在尝试打包游戏!针对Java 7构建的应用程序。我收到此错误。此外,我无法从命令行启动应用程序,但从Eclipse开始工作。

D:\Dropbox\eclipseProjectsClassic>play war MyApp -o MyApp.war --zip
~        _            _
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/
~
~ play! 1.2.3, http://www.playframework.org
~
Listening for transport dt_socket at address: 8000
04:17:03,694 INFO  ~ Starting D:\Dropbox\eclipseProjectsClassic\MyApp
Exception in thread "main" java.lang.UnsupportedClassVersionError: DocViewerPlugin : Unsupported maj
or.minor version 51.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java
:158)
        at play.classloading.ApplicationClassloader.loadClass(ApplicationClassloader.java:84)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at play.plugins.PluginCollection.loadPlugins(PluginCollection.java:100)
        at play.Play.init(Play.java:286)
        at play.server.Server.main(Server.java:158)

~ Packaging current version of the framework and the application to D:\Dropbox\eclipseProjectsClassi
c\MyApp.war ...
Traceback (most recent call last):
  File "C:\play\play", line 153, in 
    status = cmdloader.commands[play_command].execute(command=play_command, app=play_app, args=remai
ning_args, env=play_env, cmdloader=cmdloader)
  File "C:\play\framework\pym\play\commands\war.py", line 65, in execute
    package_as_war(app, env, war_path, war_zip_path, war_exclusion_list)
  File "C:\play\framework\pym\play\utils.py", line 117, in package_as_war
    copy_directory(app.path, os.path.join(war_path, 'WEB-INF/application'), war_exclusion_list)
  File "C:\play\framework\pym\play\utils.py", line 230, in copy_directory
    shutil.copyfile(from_, to_)
  File "C:\play\python\lib\shutil.py", line 53, in copyfile
    fdst = open(dst, 'wb')
IOError: [Errno 2] No such file or directory: 'D:\\Dropbox\\eclipseProjectsClassic\\MyApp.war\\WEB-
INF/application\\MyApp.war\\WEB-INF\\application\\MyApp.war\\WEB-INF\\application\\MyApp.war\\WEB
-INF\\application\\MyApp.war\\WEB-INF\\application\\MyApp.war\\WEB-INF\\application\\test\\data
\\DataCollectorTest.java'

UPDATE 我通过将JAVA_HOME系统变量更改为jdk7目录解决了UnsupportedClassVersionError问题。 IOError仍然会出现。

UPDATE2 通过将te输出目录更改为“C:\ MyApp.war”来解决IOError

1 个答案:

答案 0 :(得分:0)

如果我从Play 1.2.4RC1的发行说明中理解,Play 1.2.3没有完整的Java 7支持。尝试使用Play framework download page中的新Play 1.2.4候选版本吗?它的发行说明告诉我“Java 7现在支持开箱即用”。