首页 新闻 会员 周边

新建maven工程报错

0
悬赏园豆:100 [已解决问题] 解决于 2018-12-12 18:31

具体情况时这样的,公司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 为什么就不行了呢,官网是假的?

问题补充:

为什么没人理呀?大哥大佬们?在线等 急~~

木初老狗的主页 木初老狗 | 初学一级 | 园豆:114
提问于:2018-12-03 15:25
< >
分享
最佳答案
0

升级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

JDK版本错误:Unsupported major.minor version 51.0

收获园豆:100
ycyzharry | 高人七级 |园豆:25653 | 2018-12-03 16:55
其他回答(1)
0

你怎么下的?直接eclipse里就可以安装的吧。

DluT_eDdy | 园豆:204 (菜鸟二级) | 2018-12-03 16:29
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册