Unsupported major.minor version 52.0, tomcat 7, java 7/8 problems
Question: I know there are tons of these questions. I have been through a lot. I have
been stuck on this issue for >24 hours.

I am using:

  * Windows 8.1, 64bit
  * Eclipse as IDE
  * Tomcat 7

I want to do:

Make a small website with 4 pages that loads data from an sql server and some
other simple stuff. The java code works if I run it as plain java in Eclipse.

The code also works if I run it in the JSP project with java 8 on localhost.

However, I need to host it on a java 7 server. I cannot update the server.

First I tried just uploading it anyway (by exporting to .war and uploading
that), but that did not work. Then, I set all settings
(preferences/java/compiler, preferences/java/installed JREs) to java 7 while
using java 8. Projects are not overriding the default.

Setting my localhost to java 7 settings makes the localhost JSP unable to work
too (same error), but it still works in plain java on my computer.

I have tried cleaning temporary/compiled files to force a recompilation
(project/clean). I have done this every time between trying new things.

I am importing the classes to the JSP server using:

    
    
    <%@ page import="jdbc.Publication"%>
    <%@ page import="jdbc.SQLPublicationMapper"%>
    

and these are the names of my classes. The classes are in the `WEB-
INF\classes` folder in the JSP folder. I copy them from the `jdbc\bin\jdbc`
folder from the other project after compiling them.

There are no compilation errors.

There are no relevant warnings. They all concern HTML formatting stuff.

I have tried to completely uninstall java 8 and only have java 7 installed
(JRE and JDK), but still I get the same error. Yes, I have recompiled the
files after this.

I am running out of ideas to try. This makes no sense to me.

I am not normally a java developer, I code in R/python/php/js, so please give
answers I can understand.

Any ideas?


Answer: Turns out the solution was something more mundane. Apparently the server was
not appropriately using the .class files I had given it. These were the files
I was updating. Instead it was relying on an old .jar file containing the same
classes. Thus, I thought it was using the class files, but it was instead
using this old .jar file. This .jar file was exported from java 8. Exporting a
new version of this file fixed the issue.

TL;DR Make sure eventual .jar files are also updated, not just .class files.

