开发者

Grails 1.1 and JDK 1.5/1.6 "Bad version number in .class file"

My development environment (Mac OS 10.6) uses JDK 1.6 while production relies on 1.5. Upgrading the prod to 1.6 isn't an option at the moment so I followed the steps to install 1.5 on my machine. However, after I set the correct JAVA_HOME version to 1.5 with Grails 1.1, I get the error message:

2009-11-12 09:20:34,881 INFO  [STDOUT] 09:20:34,881 INFO  [[/]] Initializing Spring root WebApplicationContext
2009-11-12 09:20:59,026 INFO  [STDOUT] 09:20:59,002 ERROR [ContextLoader] Context
initialization failed org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'pluginManager' defined in ServletContext 
resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; 
nested exception is java.lang.UnsupportedClassVersionError: 
Bad version number in .class file
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
    a开发者_开发技巧t org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)

This is a similar problem as listed in this forum but the option to set 'grails war -Dtarget.jdk=1.5' doesn't work and I'm not sure which files (and how) would need to get modified to compile the project against 1.5. (The author of the suggested script hack notes that the solution is not one he's tried)

I was under the impression that Grails 1.1 was compiled with 1.5.

What else can be done to resolve this error?


grails clean should help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜