【发布时间】:2009-12-02 17:08:50
【问题描述】:
我认为我最近没有对我的机器配置进行任何调整,但突然之间,在我执行了“grails clean”,然后是“grails war”之后,我无法构建我的项目,原因是: “java.lang.UnsupportedClassVersionError”。
JDK: 1.5.0_19 on MacOS 10.6
Grails: 1.1.1
Groovy: 1.6.5
这是我执行“grails war”时得到的结果:
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
我有一些包含 java/part Groovy 类的 jar,它们是使用 Groovy 1.6.5 编译的。
我从哪里开始寻找导致此问题的原因?在 Grails 1.1 之前,我不记得框架有这么多问题。
【问题讨论】:
-
部分问题可能是由于 MacOS X 10.6 没有或不支持 JDK 1.5(我知道你可以自己添加...)