I am getting this error
java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=map/CareMonths, offset=6
My Eclipse\'s J
I was getting this error in websphere 8.5:
java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=com/xxx/Whatever, offset=6
I had my project JDK level set at 1.7 in eclipse and was8 by default runs on JDK 1.6 so there was a clash. I had to install the optional SDK 1.7 to my websphere server and then the problem went away. I guess I could have also set my project level down to 1.6 in eclipse but I wanted to code to 1.7.
In this Eclipse Preferences panel you can change the compiler compatibility from 1.7 to 1.6. This solved the similar message I was getting. For Eclipse, it is under: Preferences -> Java -> Compiler: 'Compiler compliance level'
This error can occur if you project is compiling with JDK 1.6 and you have dependencies compiled with Java 7.
If the log indicates java.lang.UnsupportedClassVersionError: JVM**** bad major version.
Then the code and server is not compiled with the same JDK version.
To fix this, please switch the JDK version either in code or server JDK.
Try this:- In the below use case, im switching to 1.7_64 (JDK 1.7 64 bit)
c:\IBM\WebSphere\WSRR\v8.5\bin\managesdk.bat -enableProfile -profileName WSRRSrv01 -sdkname 1.7_64
I fixed it by setting up env. variable JAVA_HOME.
At first you should check major version of compiled problematic .class
file, in your case map/CareMonths
. See this answer how to do it.
WAS7 uses Java 6 (as said Jacek), and Java 6 uses major version 50, so you have to compile your project with Java 6. How to set proper version of Java compiler depends on your IDE (e.g. Eclipse, IntelliJ) or build tool (e.g. Maven, Ant).