Monday, February 6, 2012

STS grails Unsupported major.minor version 51.0

I recently upgraded to JDK version 7 on my development machine, which started to cause an error in my development IDE, Spring's STS for Grails development

I configured the workspace settings to use the newly installed JDK 7 as shown below:



 When I went to run the application, I got the following error:

Error Error packaging application: Error occurred processing message bundles: java.lang.UnsupportedClassVersionError: sun/tools/native2ascii/Main : Unsupported major.minor version 51.0

After some researching on the web, it turns out the Java version used to COMPILE the code was different from the java version used to RUN the code.

It turns out, my run configuration (right click project -> run as -> run configurations) was set to use the older Java version 6 as shown below:



I switched it to use Java 7, and now the application runs again!




Reference:
 http://stackoverflow.com/questions/8398956/grails-deployment-error

1 comment:

  1. Thank you for the info. It sounds pretty user friendly. I guess I’ll pick one up for fun. thank u

    Web Developers in Chennai

    ReplyDelete