Use Maven to package the project and execute the mvn clean package -DskipTests command to report an error JAVA_HOME should point to a JDK not a JRE

 

F:\MyLearningFiles\demo1\ssm>mvn clean package -DskipTests
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

Solution

Solution: In maven\apache-maven-3.5.4\bin, here is your maven installation address directory, there is a mvn.cmd in it . Open and add set JAVA_HOME=D:\Program Files\Java\jdk1.8.0_91 on the first line, here is your jdk installation directory. Just re-execute.

 

 

Guess you like

Origin blog.csdn.net/m0_47010003/article/details/127952043