Unsupported major.minor version Error
Unsupported major.minor version error is because of Java version mismatch. It happens when you compile your projects on higher version of java(e.g. jdk 1.8) and then run it on a lower version (e.g. jdk 1.7). Depending on your situation, you have two ways to resolve this error: compile your code for an earlier version of Java, or run your code on a newer Java version. Sometimes you may have more than one version of Java SDK installed in your machine. Make sure the application you are running is pointing to the right or highest version available . It is better you need to install both JRE/JDK with the same version.
Java minor_version, major_version
The values of the minor_version and major_version items are the minor and major version numbers of this Java class file. Together, a major and a minor version number determine the version of the .class file format. If a class file has major version number M and minor version number m, we denote the version of its class file format as M.m. Thus, class file format versions may be ordered lexicographically , for example, 1.5 < 2.0 < 2.1.Major version number of the class file format being used.
- Java SE 14 = 58 (0x3A hex)
- Java SE 13 = 57 (0x39 hex)
- Java SE 12 = 56 (0x38 hex)
- Java SE 11 = 55 (0x37 hex)
- Java SE 10 = 54 (0x36 hex)
- Java SE 9 = 53 (0x35 hex)
- Java SE 8 = 52 (0x34 hex)
- Java SE 7 = 51 (0x33 hex)
- Java SE 6.0 = 50 (0x32 hex)
- Java SE 5.0 = 49 (0x31 hex)
- JDK 1.4 = 48 (0x30 hex)
- JDK 1.3 = 47 (0x2F hex)
- JDK 1.2 = 46 (0x2E hex)
- JDK 1.1 = 45 (0x2D hex)
Java Compatibility
Java strongly tries to be backward compatible but sometimes changes that are not backward compatible are necessary to evolve the ecosystem . Usually, many people think why do you get a version mismatch error if Java is backward compatible . Well, its true that Java is backward compatible, which means you can run a Java class file or Java binary (JAR file) compiled in lower version (java 6) into higher version e.g. Java 8, but it doesn't mean that you can run a class compiled using Java 7 into Java 5, it is because higher version usually have features which are not supported by lower version . For e.g. 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. To fix the actual problem you should try to either run the Java code with a newer version of Java JRE or specify the target parameter to the Java compiler to instruct the compiler to create code compatible with earlier Java versions .Eclipse
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.
Select the check box to activate the required version of JRE. 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 list Compiler compliance level the same version that you set in the previous step.

If the version of compiler compliance level and Installed JRE is different, eclipse gives the messages as follows. "When selecting 1.8 compliance, make sure to have a compatible JRE installed and activated (currently 1.7)"
Android Studio
If you have installed Android N , change Android rendering version with older one and the problem will disappear.
NetBeans
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. If you are using Maven , you can set the JDK version of each module by placing a file called nb-configuration.xml beside your pom.xml with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<netbeans.hint.jdkPlatform>JDK_1.7</netbeans.hint.jdkPlatform>
</properties>
</project-shared-configuration>
The "JDK_1.7" Java platform must be configured in Tools -> Java Platforms -> Add Platform .
Related Topics
- Java Interview Questions-Core Faq - 1
- Java Interview Questions-Core Faq - 2
- Java Interview Questions-Core Faq - 3
- Important features of Java
- Difference between Java and JavaScript?
- What is the difference between JDK and JRE?
- What gives Java its 'write once and run anywhere' nature?
- What is JVM and is it platform independent?
- What is Just-In-Time (JIT) compiler?
- What is the garbage collector in Java?
- What is NullPointerException in Java
- Difference between Stack and Heap memory in Java
- How to set the maximum memory usage for JVM?
- What is numeric promotion?
- Why do we need Generic Types in Java?
- What does it mean to be static in Java?
- What are final variables in Java?
- How Do Annotations Work in Java?
- How do I use the ternary operator in Java?
- What is instanceof keyword in Java?
- How ClassLoader Works in Java?
- What are fail-safe and fail-fast Iterators in Java
- What are method references?
- "Cannot Find Symbol" compile error
- Difference between system.gc() and runtime.gc()
- How to convert TimeStamp to Date in Java?
- Does garbage collection guarantee that a program will not run out of memory?
- How setting an Object to null help Garbage Collection?
- How do objects become eligible for garbage collection?
- How to calculate date difference in Java
- Difference between Path and Classpath
- Is Java "pass-by-reference" or "pass-by-value"?
- Difference between static and nonstatic methods java
- Why Java does not support pointers?
- What is package in Java?
- What are wrapper classes?
- What is singleton class in Java?
- Difference between Java Local Variable, Instance Variable and a Class Variable?
- Can a top level class be private or protected in java
- Are Polymorphism , Overloading and Overriding similar concepts?
- How to Use Locks in Java
- Why Multiple Inheritance is Not Supported in Java
- Why Java is not a pure Object Oriented language?
- Why can't a Java class be declared as static?
- Difference between Abstract class and Interface in Java
- Why do I need to override the equals and hashCode methods in Java?
- Why does Java not support operator overloading?
- What’s meant by anonymous class in Java?
- Static Vs Dynamic class loading in Java
- Why am I getting a NoClassDefFoundError in Java?
- How to generate random integers within a specific range in Java
- What's the meaning of System.out.println in Java?
- What is the purpose of Runtime and System class?
- What is finally block in Java?
- What is difference between final, finally and finalize?
- What is try-with-resources in java?
- What is a stacktrace?
- What is the meaning of immutable in terms of String?
- What are different ways to create a string object in Java?
- Difference between String and StringBuffer/StringBuilder in Java
- What is the difference between creating String as new() and literal?
- How do I convert String to Date object in Java?
- How do I create a Java string from the contents of a file?
- What actually causes a StackOverflow error in Java?
- Why is char[] preferred over String for storage of password in Java
- What is I/O Filter and how do I use it in Java?
- Serialization and Deserialization in Java
- Understanding transient variables in Java
- What is Externalizable in Java?
- What is the purpose of serialization/deserialization in Java?
- What is the Difference between byte stream and Character streams
- How to append text to an existing file in Java
- Read/convert an InputStream to a String in Java
- What is the difference between Reader and InputStream in Java
- Introduction to Java threads
- What is synchronization Java?
- Static synchronization Vs non static synchronization in Java
- Java Thread Deadlock Tutorial
- What is Daemon thread in Java
- Difference between implements Runnable and extends Thread in Java
- What is the volatile keyword in Java
- What are the basic interfaces of Java Collections Framework
- What are the differences between ArrayList and Vector in Java
- What is the difference between ArrayList and LinkedList?
- What is the difference between List and Set in Java
- Difference between HashSet and HashMap in Java
- Difference between HashMap and Hashtable in Java?
- How does the hashCode() method of java works?
- Difference between capacity() and size() of Vector in Java
- What is a Java ClassNotFoundException?