eclipse 运行Android项目时发生错误 - 不支持的major.minor版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36008207/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 23:05:05  来源:igfitidea点击:

Error Occurs while Running Android Project - Unsupported major.minor version

javaandroideclipse

提问by Vishnu M A

While running the code it shows a alert

运行代码时,它会显示警报

Errors occurred during the build Errors running builder 'Android Package Builder' on project 'Test'.com/android/dx/command/dexer/Main : Unsupported major.minor version 52.0

构建过程中出现错误在项目“Test”.com/android/dx/command/dexer/Main 上运行构建器“Android Package Builder”时出错:不支持major.minor 版本 52.0

This is the error shown

这是显示的错误

Eclipse was running properly but after the updation of eclipse it shows the error.previously it was running well,i.e before updation help me solve this issue and run my project.

Eclipse 运行正常,但在 Eclipse 更新后显示错误。以前它运行良好,即在更新之前帮助我解决此问题并运行我的项目。

also help me with some update-able adt bundle.

还可以帮助我提供一些可更新的 adt 包。

采纳答案by Vishnu M A

Solved the issue , Previously I compiled with jAVA 1.7 and run in jdk 1.8 that was the reason of my issue now i download JAVA 1.8 now it is running

解决了这个问题,以前我用 jAVA 1.7 编译并在 jdk 1.8 中运行,这是我的问题的原因,现在我下载 JAVA 1.8 现在它正在运行

  • J2SE 8=52,
  • J2SE 7=51,
  • J2SE 6.0=50,
  • J2SE 5.0=49,
  • JDK 1.4=48,
  • JDK 1.3=47,
  • JDK 1.2=46
  • JDK 1.1=45
  • J2SE 8=52,
  • J2SE 7=51,
  • J2SE 6.0=50,
  • J2SE 5.0=49,
  • JDK 1.4=48,
  • JDK 1.3=47,
  • JDK 1.2=46
  • JDK 1.1=45

enter image description here

在此处输入图片说明

回答by Kevin ABRIOUX

I have got the same exact issue, but not the same solution solved it :

我遇到了完全相同的问题,但解决方案不一样:

To fix this, i have to go in my project.propertiesfile :

要解决这个问题,我必须进入我的project.properties文件:

enter image description here

在此处输入图片说明

And in this file add this line :

在这个文件中添加这一行:

sdk.buildtools=23.0.3

回答by Pratik Tank

your code might has been compiled with Java Higher version(i.e. 8), while you are trying to run it with Java Lower version(i.e. 7). Note that Eclipse has it's own compiler and does not use the one from the JDK and most probably it is configured to use Java Higher version(i.e. 8). Check you eclipse compiler preferences.

您的代码可能已使用 Java 更高版本(即 8)编译,而您正在尝试使用 Java 较低版本(即 7)运行它。请注意,Eclipse 有自己的编译器,不使用 JDK 中的编译器,而且很可能它被配置为使用 Java 更高版本(即 8)。检查您的 Eclipse 编译器首选项。

回答by Kishor Patil

The only one reason for Unsupported major.minor version 52.0in eclipse is API Level 24

eclipse 中Unsupported major.minor version 52.0的唯一原因是 API Level 24

So please do following things to resolve Issue in Eclipse :

因此,请执行以下操作来解决 Eclipse 中的问题:

  1. GO To Windowmenu
    2.Open Android SDK manager
    3.Check is API level 24 is installed any Platform
    4.If YESPlease Uninstall this API level 24 Packages.
    5.Clean Project and Run Again.
  1. 转到窗口菜单
    2.打开Android SDK 管理器 3.
    检查是否安装了 API 级别 24 任何平台
    4.如果是,请卸载此 API 级别 24 包。
    5.清理项目并再次运行。

And its Work fine.

它的工作正常。

回答by Amar

Adding the below line in project.properties and setting Java to 1.7 solved the issue to me.

在 project.properties 中添加以下行并将 Java 设置为 1.7 解决了我的问题。

sdk.buildtools=23.0.3

sdk.buildtools=23.0.3