Why do I get an UnsupportedClassVersionError for my Java app?

Issue

If you see an error such as java.lang.UnsupportedClassVersionError: play/runsupport/classloader/ApplicationClassLoaderProvider: Unsupported major.minor version 52.0.

Resolution

This issue arises when users attempt to run a Java Virtual Machine (JVM) application on an older version of the JDK that has been compiled using a newer version of JDK.

To determine the Java version on Heroku, execute the following command: heroku run java -version. Ensure that you are using the appropriate JDK version by configuring it within the 'system.properties' file, and make sure this file is committed to your Git repository.

You would need to ensure that the JVM app is compiled with the same or an older version of the JDK than the version it is running on.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support