maven编译环境配置
- 列表内容
设置系统环境变量:MAVEN_OPTS=-Dfile.encoding=utf-8:
windows:
我的电脑–》属性–》高级系统设置–》高级–》环境变量(N)…–》新建(N)…
变量名:MAVEN_OPTS
变量值:-Dfile.encoding=utf-8
linux:
cd
echo “MAVEN_OPTS=-Dfile.encoding=utf-8” >> .bash_profile
echo “export MAVEN_OPTS” >> .bash_profile
- 列表内容
.对于eclipse设置:
windows–》preferences–》General–》workspace–》Text file encoding
other–》utf-8
如果通过eclipse–》run执行maven编译、打包报错,请检查下面红色框内的值:
如果还是编译不通过,再修改eclipse的jvm参数,如下图所示:
如果还解决不了,再添加系统环境变量JAVA_TOOL_OPTIONS
JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8