Maven常见错误和SpringBoot常见错误汇总

Maven环境搭建错误

1.错误提示:

The JAVA_HOME environment variable is not defined correctly. 
This environment variable is needed to run this program 
NB: JAVA_HOME should point to a JDK not a JRE.

解决办法如下:原因还是JAVA_HOME环境变量配置错误,

# Java
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH
          
# Maven  
MAVEN_HOME=/Users/jh/Maven/apache-maven-3.5.4
export MAVEN_HOME
export PATH=$MAVEN_HOME/bin:$PATH

2.错误提示:

[ERROR] Error executing Maven.
[ERROR] 2 problems were encountered while building the effective settings
[FATAL] Non-parseable settings D:\apache-maven-3.2.5\conf\settings.xml: Duplicated tag: 'mirrors' (position: START_TAG seen ...the preferred\n   | server for that repository.\n   |-->\n  ... @154:12)  @ D:\apache-maven-3.2.5\conf\settings.xml, line 154, column 12
[FATAL] Non-parseable settings D:\apache-maven-3.2.5\conf\settings.xml: Duplicated tag: 'mirrors' (position: START_TAG seen ...the preferred\n   | server for that repository.\n   |-->\n  ... @154:12)  @ D:\apache-maven-3.2.5\conf\settings.xml, line 154, column 12

解决办法:Maven 文件中的setting.xml中出现重复标签,如:

 

你可能感兴趣的:(常见错误)