./mvnw spring-boot:run command displays a "not found" error

Viewed 20

thi command for running the server doesn`t work and displays: JAVA_HOME not found in your environment

error

1 Answers

Go to start, then Edit the system Environment Variables

Then go to Advanced tab, press Environment Variables

Click on New.. at System Variables half

add JAVA_HOME at variable name, and $PATH at variable value

$PATH is where you have java installed, It Should be something like this C:\Java\jdk1.8.0_291

A simpler solution would be using CMD run as administrator

setx JAVA_HOME "C:\Java\jdk1.8.0_291" /M

Related