Unsupported major.minor version 52.0

服务器运行Java Web 项目  启动报错:

143520_lFQu_2505806.png

google 的 解决方案:

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>

大概的意思 就是说 项目用1.8搞的,就要运行在 1.8的JDK上 ,运行在1.7就出这个错误.

然后我就豁然开朗,  在这里记录一下。 

转载于:https://my.oschina.net/u/2505806/blog/792876

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值