I read through about 20 threads on this error and my issue is still not sorted and hence this question. Other thread which seemingly answer this question does not work in the following case or atleast, I don't know how.
My machine is Mac running Sierra. My java details are :
iMacRamesh:bin admin$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home
iMacRamesh:bin admin$ java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
It is a servlet running on Tomcat 7. I compiled the program and am trying to run this when I get this error. My program uses a lot of third party libraries which are old. That said, my error is
java.lang.UnsupportedClassVersionError: eself/tool/servlet/Relevance : Unsupported major.minor version 51.0 (unable to load class eself.tool.servlet.Relevance)
The Relevance class is the new program that is definitely compiled on Java 7. That's all the Java I have, far as I can tell. From all the threads I have read, everyone suggests that such errors may be coming from when you are running a earlier version of java accessing a later version of the class file.
I would love to get someone to chime in on this.