-
解决1:File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
-
解决2:不再支持源选项 5。请使用 6 或更高版本。 不再支持目标选项 1.5。请使用 1.6 或更高版本
- 两个问题在maven中的pom.xml文件中添加下面代码段
<properties>
<!--解决File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!--不再支持源选项 5。请使用 6 或更高版本。 不再支持目标选项 1.5。请使用 1.6 或更高版本-->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
- 修改模块编译源的jdk版本为当前本地版本 project Structure -->Modules --> Sources
- 解决3 maven启动中文乱码问题:
因为maven默认是GBK编码,IDEA是默认utf-8编码,故乱码。解决如下
file --> Setting --> 搜索Maven --> maven --> Runner 中设置 VM Options为 -Dfile.encoding=GBK