具体情况时这样的,公司jdk为1.6 ,eclipse为kepler版本 ,为了和他们俩不冲突,我下载了maven3.2.5,然后各种配置。。。。。
新建maven项目pom第一行报错:org/apache/maven/plugins/war/WarMojo : Unsupported major.minor version 51.0
然后下面的plugin标签:Multiple annotations found at this line:
- CoreException: Could not get the value for parameter compilerId for plugin execution default-
testCompile: TypeNotPresentException: Type org.apache.maven.plugin.compiler.TestCompilerMojo not
present: UnsupportedClassVersionError: org/apache/maven/plugin/compiler/TestCompilerMojo :
Unsupported major.minor version 51.0
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-
compiler-plugin:3.7.0:testCompile (execution: default-testCompile, phase: test-compile)
- CoreException: Could not get the value for parameter compilerId for plugin execution default-
compile: TypeNotPresentException: Type org.apache.maven.plugin.compiler.CompilerMojo not present:
UnsupportedClassVersionError: org/apache/maven/plugin/compiler/CompilerMojo : Unsupported
major.minor version 51.0
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-
compiler-plugin:3.7.0:compile (execution: default-compile, phase: compile)
我真的不知道该怎么解决,网上都说jdk版本和maven冲突,我按照maven官网给出的jdk'版本对应要求下载的3.2.5 为什么就不行了呢,官网是假的?
升级jdk版本就好了
这个错误时因为JDK版本的问题,比如本机的JDK为1.6,但是项目编译时用的JDK为1.7那么就会出现这个异常,因为本机JDK版本较低不能执行编译版本为高版本的Class文件,各JDK版本对应的错误编号如下:
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
你怎么下的?直接eclipse里就可以安装的吧。