Maven Java home configuration

user2109307 picture user2109307 · Jun 22, 2017 · Viewed 8.5k times · Source

I installed JDK and set up Maven. Call of mvn -version i get returns:

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 variable is set to C:\Program Files\Java\jdk1.8.0_131\bin in system variables.

Call of %JAVA_HOME% returns path C:\Program Files\Java\jdk1.8.0_131\bin.

Where is the problem?

Answer

BackSlash picture BackSlash · Jun 22, 2017

As you can see in the documentation the JAVA_HOME variable must point to the java installation path, not to the bin folder.

Change it to C:\Program Files\Java\jdk1.8.0_131