This question already has an answer here:
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
<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?
None of these answers helped me, but I found a solution.
I had a webproject used in Wildfly 8.2, built with Maven, source and target was set to 1.8 on maven-compiler-plugin, as well as all Eclipse and Maven settings were set to Java 1.8. The problem was that Wildfly 8.2 cannot handle Java 1.8, so I had to set everything to 1.7 and it worked.
You must run and compile your application with the same version of Java.
If you're using Eclipse you should do 2 things:
In Eclipse, click on "Window > Preferences", and in the window that appears, on the left side, under "Java", click on "Installed JREs", click on "Add..." and navigate to the folder that contains the JDK.
Right-click on your project and click on "Properties", in the window that appears, on the left side, click on "Java Compiler" and uncheck "Use compliance from execution environment on the Java Build Path", this allows you to choose in the the list "Compiler compilance level" the same version that you set in the previous step.
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.
Unsupported major.minor version 52.0 comes when you are trying to run a class compiled using Java 1.8 compiler into a lower JRE version e.g. JRE 1.7 or JRE 1.6. Simplest way to fix this error is install the latest Java release i.e. Java 8 and run your program.
Read more: http://javarevisited.blogspot.com/2015/05/fixing-unsupported-majorminor-version.html#ixzz4AVD4Evgv
If you are using Eclipse, make sure your menu Project → Properties → Java build path → libraries → JRE system library matches your project requirements (as shown in the image).
I solved my problem by removing old versions of JRE and installing JRE 8.