Servlet Exception - servlet.init() (UnsupportedClassVersion)

79 Views Asked by At

I've been having this problem for days now. I deploy my server using tomcat7, try to acess it and it gives me a Status 500 - Internal Server Error. https://justpaste.it/3xw20

It has nothing to do with the code as this works on a mac. I have tried to downgrade my java to java11 and I think I have it but I'm not sure? As further down the error is "(...) has been compiled by a more recent version of Java Runtime (...)

I've literally tried so many things... mvn clean, restarting everything, environment variables, dependencies, etc... The only thing that comes to mind is possibly different versions of Intellij, java? But I don't know how to fix that.

1

There are 1 best solutions below

2
On

By "this works on a mac" if you mean that it works locally then try updating the version of Java on the server that you are running your Tomcat 7 and you application on.

UnsupportedClassVersionError occurs when you compile with one version of Java and execute with an older version. You can try this out by maven installing with one java version and setting your intellij preferences to run the app on an older version.