Note that there are some explanatory texts on larger screens.

plurals
  1. POGrails 1.1 and JDK 1.5/1.6 "Bad version number in .class file"
    text
    copied!<p>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 <a href="http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard" rel="nofollow noreferrer">install 1.5 on my machine</a>. However, after I set the correct JAVA_HOME version to 1.5 with Grails 1.1, I get the error message:</p> <pre><code>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) at 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) </code></pre> <p>This is a similar problem as listed in this <a href="http://old.nabble.com/dev-%3D-Java-6--but-prod-%3D-Java-1.5.-How-to-deploy-compatible-class-files-td15751505.html" rel="nofollow noreferrer">forum</a> 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)</p> <p>I was under the impression that Grails 1.1 was compiled with 1.5. </p> <p>What else can be done to resolve this error?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload