Unsupported major.minor version 52.0 [duplicate]

2018-12-31 00:48发布

This question already has an answer here:

Pictures:

Command Prompt showing versions Command Prompt showing versions

Picture of error 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

<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?

26条回答
还给你的自由
2楼-- · 2018-12-31 01:43

I had the same problem... a JDK and plug-in version conflict.

I compiled using 1.8 ... the latest one, and that message started to appear. 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.

Using NetBeans, and compiling, and targeting to version 1.7, fixed my problem.

查看更多
刘海飞了
3楼-- · 2018-12-31 01:43

Just go to http://java.com/en/download/ and update your version of JRE

查看更多
登录 后发表回答