本文翻译自:Unsupported major.minor version 52.0 [duplicate]

This question already has an answer here: 这个问题已经在这里有了答案:

  • How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version 48 answers 如何修复java.lang.UnsupportedClassVersionError:不支持的major.minor版本 48回答

Pictures: 图片:

Command Prompt showing versions 命令提示符显示版本

Picture of error 错误图片

Hello.java 你好

import java.applet.Applet;
import java.awt.*;public class Hello extends Applet {// Java applet to draw "Hello World"public void paint (Graphics page) {page.drawString ("Hello World!", 50, 50);}
}

Hello.html Hello.html

<HTML><HEAD><TITLE>HelloWorld Applet</TITLE></HEAD><BODY><APPLET CODE="Hello.class" WIDTH=300 HEIGHT=150></APPLET></BODY>
</HTML>

Error 错误

Hello : Unsupported major.minor version 52.0

What may the problem be? 可能是什么问题?


#1楼

参考:https://stackoom.com/question/1WMWE/不支持的major-minor版本-重复


#2楼

The smart way to fix that problem is to compile using the latest SDK and use the cross compilation options when compiling. 解决此问题的明智方法是使用最新的SDK进行编译,并在编译时使用交叉编译选项 。 To use the options completely correctly requires the rt.jar of a JRE ( not JDK ) of the target version. 完全正确地使用这些选项需要目标版本的JRE( 不是JDK )的rt.jar

Given the nature of that applet, it looks like it could be compiled for use with Java 1.1. 鉴于该applet的性质,它看起来可以进行编译以与Java 1.1一起使用。


#3楼

I had the same problem... a JDK and plug-in version conflict. 我遇到了同样的问题... JDK和插件版本冲突。

I compiled using 1.8 ... the latest one, and that message started to appear. 我使用1.8 ...进行了编译,最新的版本开始出现。 So I've searched for the JRE 7 ( http://www.oracle.com/technetwork/java/javase/downloads/server-jre7-downloads-1931105.html )... and installed it... again... Now 1.8 and 1.7 in the same computer. 因此,我搜索了JRE 7( http://www.oracle.com/technetwork/java/javase/downloads/server-jre7-downloads-1931105.html )...并再次安装了它。现在1.8和1.7在同一台计算机上。

Using NetBeans, and compiling, and targeting to version 1.7, fixed my problem. 使用NetBeans进行编译,并以1.7版为目标,解决了我的问题。


#4楼

If you're using the NetBeans IDE, right click on the project and choose Properties and go to sources , and you can change the Source/Binary Format to a lower JDK version. 如果您使用的是NetBeans IDE,请右键单击该项目,然后选择“ 属性”并转到“ 源” ,然后可以将“源/二进制格式”更改为较低的JDK版本。


#5楼

You will need to change your compiler compliance level back to 1.7 in your IDE. 您将需要在IDE中将编译器的符合性级别更改回1.7。

This can be done in the preferences settings of your IDE. 这可以在IDE的首选项设置中完成。 For example, in Eclipse go to menu WindowsPreferences , select Java, and expand it. 例如,在Eclipse中,转到菜单Windows首选项 ,选择Java,然后将其展开。 Then select Compiler and change the compliance level to 1.7. 然后选择编译器 ,并将合规级别更改为1.7。 I am sure this will work from there. 我确信这将从那里开始。


#6楼

This occurred to me when I installed a fresh Java 1.8, but left the old command line interpreter open. 当我安装了新的Java 1.8时,这发生在我身上,但是打开了旧的命令行解释器。

It had an old path and kept on executing the application with Java 1.7 whereas project was already built with Java 1.8. 它的路径很旧,并且继续使用Java 1.7执行应用程序,而项目已经使用Java 1.8构建。

不支持的major.minor版本52.0 [重复]相关推荐

  1. 报错:Unsupported major.minor version 52.0 (jar包对不同JDK版本的兼容性问题:)

    Unsupported major.minor version 52.0 这类错误是因为Java版本不一致造成的,在高版本的JDK(1.8)环境中编译JAR包,然后JAR在低版本的JVM(1.6)中运 ...

  2. IDEA java版本降级编译,解决JDK版本导致Unsupported major.minor version 52.0 error

    Intellij IDEA使用教程相关系列 目录 具体的操作,这位博友整理得很详细https://blog.csdn.net/huyishero/article/details/61916516 补充 ...

  3. com/android/dx/command/dexer/Main : Unsupported major.minor version 52.0

    eclipse运行android project报错com/android/dx/command/dexer/Main : Unsupported major.minor version 52.0 之 ...

  4. Android Studio出现UnsupportedClassVersionError Unsupported major.minor version 52.0

    解决Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.mino ...

  5. Unsupported major.minor version 52.0那点坑

    先吐槽一下,eclipse虽然看起来简洁,但是对于android开发者来说在很多方面还是极为的不利 先说说这个问题的来源,由于更新了最新的SDK,导致出现了 Unsupported major.min ...

  6. Unsupported major.minor version 52.0 解决方案

    Unsupported major.minor version 52.0 这个错误网上一百度一大堆,我就简单的记一下. 直译过来意思是:不支持version52.0,其中version 52.0是魔码 ...

  7. java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0

    今天用mybatis-generator生成代码的时候,报了java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupp ...

  8. java.lang.UnsupportedClassVersionError: com/wyf/test/non/T : Unsupported major.minor version 52.0

    摘抄自本人博客,详细可以参考: https://blog.csdn.net/w8y56f/article/details/117825442 问题 java.lang.UnsupportedClass ...

  9. 快速解决方案UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupport major.minor version 52.0?

    在配置hibernate的时候报错UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupport major.minor version ...

最新文章

  1. Sampling Procedure 和 Sample-drawing Procedure, SAP QM里的双胞胎?
  2. 计算机后门做法正确的是,网络信息安全知识:张同学发现安全软件提醒自己的电脑有系统漏洞,如果你是张同学,最恰当的做法是?()...
  3. C#中System.ServiceProgress报错
  4. 如何设置iPhone的手机铃声?【来自星星的你】
  5. Code-NFine:jqgrid 数据绑定
  6. servlet中session的使用
  7. 在我的订单中,点击去付款查看每个订单详情
  8. CodeFun-UI 设计稿智能生成前端源代码
  9. 用python做一张图片_用 Python 生成一张有“内涵”的图片
  10. 《还是要相信》读书笔记
  11. python tensorflow学习笔记(五)矩阵乘法运算
  12. HG30-3交直流校准源
  13. ServiceHot ITSM助力天原集团IT运维信息化建设
  14. 超声波测距仪编程_超声波测距仪的设计和实现
  15. ubuntu上下左右wasd错乱
  16. 邓亚萍大手笔一掷20亿研发即刻搜索2年就倒闭带来的思考
  17. 计算机芯片的主要用途,汽车电脑芯片30343的主要作用是什么??
  18. unity编辑器拓展十一——将两张RGB图合并成一张
  19. 下载者DownLoader.Win32.Undef分析
  20. [转载]windbg简明教程

热门文章

  1. js返回页面并刷新页面数据
  2. 模板点击通过sql获得值 举例说明
  3. Django表单字段汇总
  4. Python-初体验
  5. 剑指Offer_27_字符串的排列
  6. ITFriend创业败局(五):创业可以停止,公司必须注销,不然后果很严重
  7. Coarse-Grained lock 粗粒度锁
  8. mssql数据库基本语句总结(2)
  9. 在Windows环境下为Python 2.5安装SSL模块
  10. Sql Server 2005“该用户与可信的SQL SERVER 连接无关联”解决方法