特殊的Eclipse java.lang.UnsupportedClassVersionError,不支持的major.minor版本52.0 [英] Peculiar Eclipse java.lang.UnsupportedClassVersionError, Unsupported major.minor version 52.0

查看:182
本文介绍了特殊的Eclipse java.lang.UnsupportedClassVersionError,不支持的major.minor版本52.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我想指出,我意识到这个问题已经被无数次询问,我知道通常的解决方案。但是,对我来说似乎不起作用。



当错误线程中的异常mainjava.lang.UnsupportedClassVersionError:org /电报/ mtproto / state / ConnectionInfo:不支持的major.minor版本52.0 发生,通常是由不兼容的JDK-JRE组合编译引起的。但是,如下图所示,我的设置似乎是按顺序的:





1. JDK Compliance





2. JRE设置





3. Java Home



什么似乎是问题?我缺少什么?我正在使用 Eclipse Luna ,尝试运行一些 Telegram API 第11层代码(该代码可以用于我估计,因为它被使用

解决方案

环境变量与 JAVA_HOME 环境变量无关Eclipse会运行代码,据我所知。同样,您为项目显示的编译器设置也不会影响代码的运行方式。



相反,您需要查看正在使用的运行配置你运行它,并检查那里的环境。确保你使用Java 8,一切都应该是好的。单击运行按钮旁边的三角形,然后选择运行配置...以打开所有设置的对话框。然后查看JRE标签,并确保您使用的是正确的JRE。


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

解决方案

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.

这篇关于特殊的Eclipse java.lang.UnsupportedClassVersionError,不支持的major.minor版本52.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆