The issue is because of Java version mismatch.
(问题是由于Java版本不匹配。)
Referring to the Wikipedia Java Class Reference : (参考Wikipedia Java类参考 :)
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 . (关于不受支持的major.minor版本的错误是因为在编译期间,您在运行时使用的是较高的JDK,而使用的是较低的JDK 。)
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.
(因此,“ major.minor版本52.0”错误可能是因为jar是在JDK 1.8中编译的,但是您正在尝试使用JDK 1.7环境运行它。)
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. (为了解决这个问题,最好让JDK和JRE指向相同的版本。)
In IntelliJ IDEA,
(在IntelliJ IDEA中,)
- Go to Maven Settings → Maven → Importing .
(转到Maven设置 → Maven → 导入 。)
Set the JDK for importer to 1.8. (将JDK for importer设置为1.8。)
- Go to Maven Settings → Maven → Runner .
(转到Maven设置 → Maven → 转轮 。)
Set the JRE to 1.8. (将JRE设置为1.8。)
- Go to menu File* → Project Structure → SDKs .
(进入菜单文件*→ 项目结构 → SDK 。)
Make sure the JDK home path is set to 1.8. (确保将JDK主目录路径设置为1.8。)
Restart IntelliJ IDEA.
(重新启动IntelliJ IDEA。)
Another approach which might help is by instructing IntelliJ IDEA which JDK version to start up with.
(另一种可能有用的方法是指示IntelliJ IDEA启动哪个JDK版本。)
Go to: /Applications/IntelliJ\ IDEA\ 15\ CE.app/Contents/Info.plist and replace the JVM version with:
(转到: / Applications / IntelliJ \ IDEA \ 15 \ CE.app/Contents/Info.plist并将JVM版本替换为:)
<key>JVMVersion</key>
<string>1.8*</string>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…