When I try running my java .jar on another machine I get the error
Unsupported major.minor version 52.0
I compiled my program using the jdk 1.6 and my machine (separate one) has java 7 installed.
This is the java version my machine is running:
Here are the settings in my IDE (Eclipse Lunar)
Why am I still getting an unsupported error?
I did check my run configuration and change it to jre6, but when I do I can't even run my program in the IDE.
Note: I would like my program to work with jdk 6, if that is not possible jdk 7.
My Class Path:
In order to overcome the UnsupportedClassVersionError, we can either compile our code for an earlier version of Java or run our code on a newer Java version.
I agree with chrylis: you believe you changed your project's compliance settings but probably you didnt.
Right click on your project and:
By the way you can "tell" eclipse that jre8 is 1.6 compliance clicking on Window/Preferences/Java/Installed JREs/Execution Environment and selecting in the left panel, Execution Environments, JavaSE-1.6 and in the Compatible JRE's panel, jre8
Hi I found this link that helped me understand the issue. Hope it is useful. Version released so far are
and from thata data it simply means
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, Why? because higher version usually have features which are not supported by lower version.
Sometimes you may have more than one version of Java installed in you machine. Make sure the application you are running is pointing to the right or highest version available.
I Encounter similar issue while doing development on Android Studio 2.2.
My Machine Configuration -
I then made below changes - 1. Uninstall JDK 1.7.0_79 2. Updated JAVA_HOME = 1.8.0_101 JDK path (Similar to SDK Location)
Now i am able to compile and run my application successfully , no more Unsupported major.minor version 52.0 Error
If you are trying to execute your program/application from the command prompt. Just make sure to restart your cmd after you have changed the JAVA_HOME var. Very simple but easily missed sometimes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With