idea 编译项目时报错:java: 无效的目标版本: 8的解决方法

最近在用maven管理jar包编译项目时,报:java: 无效的目标版本

java: 无效的目标版本

由于我的项目编译版本是jdk6,而错误报的是8,由此猜测是maven版本和jdk版本不一致导致的,

其中我项目jdk6,而maven配置的是3.6.3(ps:用的idea自带的,idea版本是2021.1版本)

根据maven官网maven版本和jdk版本的对应关系发现了问题

Maven – Maven Releases Historyicon-default.png?t=M1L8https://maven.apache.org/docs/history.html

 

完整对应关系如下:

Maven Releases History

Date format is: YYYY-MM-DD

Maven 3.1+

Release DateVersionRequired Java VersionLinks
2021-11-143.8.4Java 7announcerelease notesreference documentation
2021-09-273.8.3announcerelease notesreference documentation
2021-08-043.8.2announcerelease notesreference documentation
2021-04-043.8.1announcerelease notesreference documentation
2019-11-253.6.3announcerelease notesreference documentation
2019-08-273.6.2announcerelease notesreference documentation
2019-04-043.6.1announcerelease notesreference documentation
2018-10-243.6.0announcerelease notesreference documentation
2018-06-213.5.4announcerelease notesreference documentation
2018-03-083.5.3announcerelease notesreference documentation
2017-10-243.5.2announcerelease notesreference documentation
2017-04-073.5.0announcerelease notesreference documentation
2017-03-243.5.0-beta-1announcerelease notesreference documentation
2017-02-283.5.0-alpha-1announcerelease notesreference documentation
2015-11-143.3.9announcerelease notesreference documentation
2015-04-283.3.3announcerelease notesreference documentation
2015-03-183.3.1announcerelease notesreference documentation
2014-12-203.2.5Java 6announcerelease notesreference documentation
2014-08-173.2.3announcerelease notesreference documentation
2014-06-263.2.2announcerelease notesreference documentation
2014-02-213.2.1announcerelease notesreference documentation
2013-10-043.1.1Java 5announcerelease notesreference documentation
2013-07-153.1.0announcerelease notesreference documentation
2013-06-103.1.0-alpha-1announcerelease notes

Maven 3.0.x

Maven 3.0 has now reached its end of life. New plugin releases will require Maven 3.1 or later. The following information is made available for reference.

Release DateVersionRequired Java VersionLinks
2013-02-233.0.5Java 5announcerelease notesreference documentation
2012-01-203.0.4announcerelease notesreference documentation
2011-03-043.0.3announcerelease notesreference documentation
2011-01-123.0.2announcerelease notesreference documentation
2010-11-263.0.1announcerelease notesreference documentation
2010-10-083.0announcerelease notesreference documentation
2010-09-023.0-beta-3announcerelease notes
2010-08-103.0-beta-2announcerelease notes
2010-04-233.0-beta-1announcerelease notes
2010-04-143.0-alpha-7announcerelease notes
2010-01-103.0-alpha-6announcerelease notes
2009-11-273.0-alpha-5announcerelease notes
2009-11-173.0-alpha-4announcerelease notes
2009-11-133.0-alpha-3announcerelease notes

Maven 2

Maven 2.x has now reached its end of life. The following Maven 2.x specific documentation is archived for reference.

2014-02-18End of LifeEoL notesannounce
2009-11-082.2.1Java 5announcerelease notesreference documentation
2009-06-302.2.0announcerelease notes
2009-03-222.1.0Java 1.4announcerelease notes
2008-09-192.1.0-M1announce
2010-02-262.0.11announcerelease notesreference documentation
2009-02-182.0.10announcerelease notes
2008-04-102.0.9announcerelease notes
2007-11-272.0.8announcerelease notes
2007-06-212.0.7announcerelease notes
2007-04-012.0.6announcerelease notes
2007-02-162.0.5announcerelease notes
2006-04-112.0.4announcerelease notes
2006-03-282.0.3announcerelease notes
2006-01-172.0.2announcerelease notes
2005-12-132.0.1announcerelease notes
2005-10-202.0announcerelease notes

Maven 1

Maven 1.x has now reached its end of lifeMaven 1.x documentation is archived for reference.

2014-02-18End of LifeEoL announce
2007-06-251.1announce
2007-05-121.1-RC-1announce
2006-08-011.1-beta-3announce
2005-09-121.1-beta-2announce
2004-12-071.0.2announce
2004-11-111.0.1announce
2004-07-131.0announce
2004-03-241.0-RC2announce
2003-09-291.0-RC1announce
2003-07-141.0-beta-10announce
2002-04-111.0-beta-3announce
2002-03-301.0-beta-2announce

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱的叹息

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值