首页 > 代码库 > Maven错误 diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator)问题解决

Maven错误 diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator)问题解决

如果在Maven构建时出现:

diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)

的错误,是由于使用了complier的插件版本为1.5导致的,因为在默认不配置情况下,Maven3默认为1.5,此时如果项目上使用泛型,那么就会出现错误。

解决方法就是升级为1.8,具体参考:http://www.cnblogs.com/EasonJim/p/6810758.html

Maven错误 diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator)问题解决