java.lang.UnsupportedClassVersionErro: Unsupported major.minor version 51.0 (Unable to load class)
This exception simply means that java classes has been compiled under newer version of jdk and we are trying to run them under older version of JDK. In my case, I had compiled the project under JRE7 and I was running on JRE 6.
Using same java is the solution. Recompiling using the same version of java or running on same version of java will solve the problem.