unsupported major minor version 52 0

unsupported major minor version 52 0  using -'java,applet,version,unsupported-class-version'


Command Prompt showing versions

Picture of error


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


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


Hello : Unsupported major.minor version 52.0

Does anyone know what the problem may be?

asked Sep 16, 2015 by manju bhargava
0 votes

12 Answers

0 votes

The smart way to fix that problem is to compile using the latest SDK and use the cross compilation options when compiling. To use the options completely correctly requires the rt.jar of a JRE (not JDK) of the target version.

Given the nature of that applet, it looks like it could be compiled for use with Java 1.1.

answered Sep 16, 2015 by ukohale
0 votes

You will need to change your compiler compliance level back to 1.7 in your IDE. This can be done in the prefences settings of your IDE for example in Eclipse go to Windows ---> Prefences then select Java and expand it then select Compiler and change the compliance level to 1.7. Am sure this will work from there

answered Sep 16, 2015 by thiru
0 votes

I had the same problem... an 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, targeting to version 1.7, fixed my problem.

answered Sep 16, 2015 by rajnipancholi
0 votes

If you're using NetBeans IDE right click on the project and choose Properties go to sources, and you can change the Source/Binary Format to a lower jdk.

enter image description here

answered Sep 16, 2015 by balvant maurya
0 votes

You must run and compile your application with the same version of java

if you're using Eclipse you should make 2 things :

1-In Eclipse click on "Windows>Preferences" in the window that appears, on the left under "java" click on "installed JREs", click on add and navigate to the folder that contains JDK.

2-Right-click on your projet and click on "Properties", in the window that appears, on the left click on "Java Compiler" and uncheck "Use compilance 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.

answered Sep 16, 2015 by dhananjayksharma
0 votes

I had Java 1.7 & 1.8 installed (with SBT 2.4 that requires Java 1.8). Even though my project was linked to Java 1.8, I had to change the JAVA_HOME environment variable to point 1.8. Finally, problem solved.

answered Sep 16, 2015 by amit.gupta
0 votes

This occurred to me when I installed fresh Java 1.8 but left old command line interpreter open. It had old path and kept on executing the app with Java 1.7 whereas project was already built with Java 1.8.

answered Sep 16, 2015 by devkumargupta
0 votes

You need to use jdk1.7.0 rather than jdk1.8.0.

To make sure it, you need to delete jdk1.8.0 on your computer.

If you use mac, you need to delete:



/Library/Internet Plug-Ins/JavaAppletPlugin.plugin

Then, you need to reinstall jdk1.7.0, and you will succeed to generate the .jar file.

answered Sep 16, 2015 by akasati02
0 votes

You may want to check your Run Configurations setting if you're using Eclipse Luna and already completed all steps mentioned above.

There could be several possibilities that cause this error. The root cause is mismatch of the project require compilation in JDK1.8/JRE8 while the environment compiler is JDK1.7/JRE7.

You can check my blog post to go through all your settings are correct.

answered Sep 16, 2015 by vijayshukla80
0 votes

You need to upgrade your java version to java 8.

Downloading Latest Java Archive

Download latest Java SE Development Kit 8 release from its official download page or use following commands to download from shell.

For 64Bit

# cd /opt/

# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u51-b16/jdk-8u51-linux-x64.tar.gz"

# tar xzf jdk-8u51-linux-x64.tar.gz

For 32Bit

# cd /opt/

# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u51-b16/jdk-8u51-linux-i586.tar.gz"

# tar xzf jdk-8u51-linux-i586.tar.gz

Note: If Above wget command doesn’t not work for you watch this example video to download java source archive using terminal.

Install Java with Alternatives

After extracting archive file use alternatives command to install it. alternatives command is available in chkconfig package.

# cd /opt/jdk1.8.0_51/

# alternatives --install /usr/bin/java java /opt/jdk1.8.0_51/bin/java 2

# alternatives --config java

At this point JAVA 8 has been successfully installed on your system. We also recommend to setup javac and jar commands path using alternatives

# alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_51/bin/jar 2

# alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_51/bin/javac 2

# alternatives --set jar /opt/jdk1.8.0_51/bin/jar

# alternatives --set javac /opt/jdk1.8.0_51/bin/javac Check Installed Java Version

Check the installed version of java using following command.

root@tecadmin ~# java -version

java version "1.8.0_51" Java(TM) SE Runtime Environment (build 1.8.0_51-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode) Configuring Environment Variables

Most of java based application’s uses environment variables to work. Set the Java environment variables using following commands

Setup JAVA_HOME Variable

# export JAVA_HOME=/opt/jdk1.8.0_51 Setup JRE_HOME Variable

# export JRE_HOME=/opt/jdk1.8.0_51/jre Setup PATH Variable

# export PATH=$PATH:/opt/jdk1.8.0_51/bin:/opt/jdk1.8.0_51/jre/bin Also put all above environment variables in /etc/environment file for auto loading on system boot.

answered Sep 16, 2015 by ankitarajoria4
0 votes

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.

answered Sep 16, 2015 by sumit_jaiswalmca
0 votes

Thanks everyone for solution.

I could solve my same problem using below solution.

In my project, I added jar which were created in Java8. And my project was referring to JRE 7. When i changed project JRE to 8. My problem solved.

Steps: In eclipse, right click on project name in project explorer > build path > Libraries > click on jre version > click edit > installed JRE > add > standerd VM > select JRE home click-path (path should be localePath\java\jdk1.8.0_25\jre) > provide name > save > select same JRE for project > finish > ok Refresh/build project once > try to run your java file. it should work.

answered Sep 16, 2015 by sujata naik