Can't export Play! app as war

I'm trying to package a Play! app built against Java 7. I'm getting this error. Also, I cannot launch the app from the command line, but from Eclipse it works.

D:DropboxeclipseProjectsClassic>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:DropboxeclipseProjectsClassicMyApp
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:DropboxeclipseProjectsClassi
cMyApp.war ...
Traceback (most recent call last):
  File "C:playplay", 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:playframeworkpymplaycommandswar.py", line 65, in execute
    package_as_war(app, env, war_path, war_zip_path, war_exclusion_list)
  File "C:playframeworkpymplayutils.py", line 117, in package_as_war
    copy_directory(app.path, os.path.join(war_path, 'WEB-INF/application'), war_exclusion_list)
  File "C:playframeworkpymplayutils.py", line 230, in copy_directory
    shutil.copyfile(from_, to_)
  File "C:playpythonlibshutil.py", line 53, in copyfile
    fdst = open(dst, 'wb')
IOError: [Errno 2] No such file or directory: 'D:DropboxeclipseProjectsClassicMyApp.warWEB-
INF/applicationMyApp.warWEB-INFapplicationMyApp.warWEB-INFapplicationMyApp.warWEB
-INFapplicationMyApp.warWEB-INFapplicationMyApp.warWEB-INFapplicationtestdata
DataCollectorTest.java'

UPDATE I've solved the UnsupportedClassVersionError by changing the JAVA_HOME system variable to jdk7 directory. The IOError is still coming up though.

UPDATE2 Solved IOError by changing te output directory to "C:MyApp.war"


If I understood right from the release notes of Play 1.2.4RC1, Play 1.2.3 did not have full Java 7 support. Try it with the new Play 1.2.4 release candidate from the Play framework download page? It's release notes tell that "Java 7 is now supported out of the box in play".

链接地址: http://www.djcxy.com/p/55880.html

上一篇: 部署war文件而不是爆炸目录有什么好处?

下一篇: 无法导出播放! 应用程序为战争