Getting following exception: Exception in thread "main" java.lang.UnsupportedClassVersionError: spark/Route : Unsupported major.minor version 52.0
trying to use spark web application framework, when I execute file, it throws this exception.
Spark Framework version: 2.0.0
Java 7 (major version 51) compiled the jar file, and we tried to run it in Java 6 (major version 50), and the Java 6 prompts Unsupported major. minor version 51.0. Refer to this table for a list of the major version of the Java class file. To fix it, download the Java or JDK 7, and change the default JDK from 6 to 7.
In order to overcome the UnsupportedClassVersionError, we can either compile our code for an earlier version of Java or run our code on a newer Java version.
The solution to the UnsupportedClassVersionError error generally boils down to two options: Run the code with a newer version of Java/JRE, or. Recompile the code with an older Java/JDK compiler.
1) If you encounter UnSupportedClassVersionError, check the JRE version you are using to run program and switch to higher version for quick solution.
You are using Java files, compiled with Java 8 (version 52.0) and a JRE which does not support it (so Java < version 8)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With