关闭

unsupported major.minor version 52.0

425人阅读 评论(0) 收藏 举报
分类:

The issue is because of Java version mismatch. Referring to the Wikipedia Java Class Reference :

  • J2SE 8 = 52
  • J2SE 7 = 51 
  • J2SE 6.0 = 50 
  • J2SE 5.0 = 49
  • JDK 1.4 = 48
  • JDK 1.3 = 47
  • JDK 1.2 = 46
  • JDK 1.1 = 45

These are the reported 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 is compiled in jdk 1.8, but you are trying to run it in jdk 1.7 environment. To solve this, it's always better to have the jdk and jre pointed to the same version.

In Intellij, 

  1. Go to Maven Settings -> Maven -> Importing. Set the JDK for importer to 1.8
  2. Go to Maven Settings -> Maven -> Runner. Set the JRE to 1.8
  3. Go to File -> Project Structure -> SDKs. Make sure the JDK home path is set to 1.8

Restart Intellij

Another approach which might help is by instructing 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>
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:7789次
    • 积分:208
    • 等级:
    • 排名:千里之外
    • 原创:6篇
    • 转载:45篇
    • 译文:0篇
    • 评论:3条