Unsupported major.minor version 52.0 [duplicate]

The issue is because of Java version mismatch. Referring to the JVM specification the following are the major versions of classfiles for use with different versions of Java. (As of now, all versions support all previous versions.)

Java SE versionMajor version
1.0.245
1.145 (Not a typo, same version)
1.246
1.347
1.448
5.049
650
751
852
953
1054
1155
1256
1357
1458
1559
1660

These are the assigned major numbers. The error regarding the unsupported major.minor version is because during compile time you are using a higher JDK and a lower JDK during runtime.

Thus, the ‘major.minor version 52.0’ error is possibly because the jar was compiled in JDK 1.8, but you are trying to run it using a JDK 1.7 environment. The reported number is the required number, not the number you are using. To solve this, it’s always better to have the JDK and JRE pointed to the same version.

In IntelliJ IDEA,

  1. Go to Maven SettingsMavenImporting. Set the JDK for importer to 1.8.
  2. Go to Maven SettingsMavenRunner. Set the JRE to 1.8.
  3. Go to menu File* → Project StructureSDKs. Make sure the JDK home path is set to 1.8.

Restart IntelliJ IDEA.

Another approach which might help is by instructing IntelliJ IDEA which JDK version to start up with.

Go to: /Applications/IntelliJ\ IDEA\ 15\ CE.app/Contents/Info.plist
and replace the JVM version with:

<key>JVMVersion</key>
<string>1.8*</string>

Leave a Comment