Peculiar Eclipse java.lang.UnsupportedClassVersionError, Unsupported major.minor version 52.0

三世轮回 提交于 2019-11-30 01:20:36

问题


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).


回答1:


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.




回答2:


i see that you have a 32bits JDK version for the JDK 1.8 and a 64bits version for the JDK 1.7 i you running your project on a 64bits machine try to use the 64bits version of JDK 1.8 Note: you must have a 64bits version for eclipse too



来源:https://stackoverflow.com/questions/23624038/peculiar-eclipse-java-lang-unsupportedclassversionerror-unsupported-major-minor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!