Grails war命令导致java.lang.UnsupportedClassVersionError
我认为我最近没有对我的机器配置做任何调整,但突然之间,在我执行了“grails clean”之后,紧接着是“grails war”,我无法构建我的项目,因为:“java.lang.UnsupportedClassVersionError” 以下是我执行“圣杯战争”时得到的信息:Grails war命令导致java.lang.UnsupportedClassVersionError,java,grails,Java,Grails,我认为我最近没有对我的机器配置做任何调整,但突然之间,在我执行了“grails clean”之后,紧接着是“grails war”,我无法构建我的项目,因为:“java.lang.UnsupportedClassVersionError” 以下是我执行“圣杯战争”时得到的信息: Welcome to Grails 1.1.1 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to:
Welcome to Grails 1.1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /usr/local/grails-1.1.1
Base Directory: /Users/Robin/code/
Running script /usr/local/grails-1.1.1/scripts/War.groovy
Environment set to production
Warning, target causing name overwriting of name startLogging
[copy] Copied 6 empty directories to 3 empty directories
under /Users/robin/.grails/1.1.1/projects/wf/resources
[mkdir] Created dir: /Users/Robin/code/web-app/plugins/ui-performance-1.2.1
[copy] Copying 1 file to /Users/Robin/code/web-app/plugins/ui-performance-1.2.1
[mkdir] Created dir: /Users/robin/.grails/1.1.1/projects/wf/classes
[groovyc] Compiling 14 source files to /Users/robin/.grails/1.1.1/projects/wf/classes
[groovyc] Compiling 262 source files to /Users/robin/.grails/1.1.1/projects/wf/classes
Compilation error: java.lang.UnsupportedClassVersionError: Bad version number in .class file
我有一些JAR是java/Groovy类的一部分,它们是使用Groovy 1.6.5编译的
我从哪里开始寻找问题的根源?在Grails1.1之前,我不记得框架有这么多问题。AFAIK,Grails1.1.1不依赖于任何JDK 6.x特性,并且编译时与1.5兼容。我假设您至少安装了一个使用目标JDK 6.x编译的插件
最简单的解决方案是安装一个JDK 6.x,并用它完成所有与Grails相关的工作。如果由于某种原因这是不可能的,您可以使用来识别“坏人”,特别是在~/.grails/1.1.1/projects/wf/plugins中。然后使用svn检查“坏家伙”插件的源代码,并使用JDK1.5自己编译它 谢谢你指出这个工具。太棒了!(我需要继续使用JDK 1.5)部分问题可能是由于MacOS X 10.6没有或不支持JDK 1.5(我知道您可以自己添加它…)
Welcome to Grails 1.1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /usr/local/grails-1.1.1
Base Directory: /Users/Robin/code/
Running script /usr/local/grails-1.1.1/scripts/War.groovy
Environment set to production
Warning, target causing name overwriting of name startLogging
[copy] Copied 6 empty directories to 3 empty directories
under /Users/robin/.grails/1.1.1/projects/wf/resources
[mkdir] Created dir: /Users/Robin/code/web-app/plugins/ui-performance-1.2.1
[copy] Copying 1 file to /Users/Robin/code/web-app/plugins/ui-performance-1.2.1
[mkdir] Created dir: /Users/robin/.grails/1.1.1/projects/wf/classes
[groovyc] Compiling 14 source files to /Users/robin/.grails/1.1.1/projects/wf/classes
[groovyc] Compiling 262 source files to /Users/robin/.grails/1.1.1/projects/wf/classes
Compilation error: java.lang.UnsupportedClassVersionError: Bad version number in .class file