First of all, I'd like to point out that I am aware that this question has been asked countless times and I am aware of the usual solution. However, it doesn't seem to work for me.
When the error Exception in thread "main" java.lang.UnsupportedClassVersionError: org/telegram/mtproto/state/ConnectionInfo : Unsupported major.minor version 52.0
occurs, it is generally caused by compiling with an incompatible JDK-JRE combination. However, as shown by the images below, my setup seems to be in order:
Fig. 1. JDK Compliance
Fig. 2. JRE Setting
Fig. 3. Java Home
What seems to be the problem? What am I missing? I'm using Eclipse Luna, trying to run some Telegram API Layer 11 code (the code works I reckon, as it was used by others).
UnsupportedClassVersionError happens because of a higher JDK during compile time and lower JDK during runtime. How can i make above change? Project -> Properties -> Java Compiler Enable project specific settings. Then select Compiler Compliance Level to 1.7, 1.6 or 1.5, build and test your app.
minor version error is thrown in Java when a class is compiled using a higher version of the Java Development Kit (JDK) but executed on a lower version of the Java Runtime Environment (JRE). The exact cause is printed on the version e.g. in the case of major.
Class UnsupportedClassVersionErrorThrown when the Java Virtual Machine attempts to read a class file and determines that the major and minor version numbers in the file are not supported.
1) If you encounter UnSupportedClassVersionError, check the JRE version you are using to run program and switch to higher version for quick solution.
The JAVA_HOME
environment variable is irrelevant to how Eclipse will run code, as far as I'm aware. Likewise the compiler settings you've shown for a project don't affect how code is run.
Instead, you need to look at the Run Configuration you're using when you run it, and check the environment there. Make sure you're using Java 8, and all should be well. Click on the triangle next to the Run button, and select "Run Configurations..." to open the dialog with all the settings. Then look at the JRE tab, and ensure you're using the right JRE.
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