This is the output even though it correctly points to the JDK
C:\Users\{usr}>mvn -version
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
C:\Users\{usr}>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_191
I tried the opposite which is pointing the JAVA_HOME to the JRE and that worked for me even though it says to set its path to the JDK and not the JRE
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T03:00:29+08:00)
Maven home: C:\Program Files\Maven\apache-maven-3.6.1\bin\..
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jre1.8.0_191
Default locale: en_PH, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Details:
- apache-maven-3.6.1
- jdk1.8.0_191
- jre1.8.0_191
- %JAVA_HOME% = C:\Program Files\Java\jdk1.8.0_191
- %MAVEN_HOME% = C:\Program Files\Maven\apache-maven-3.6.1
I don't really understand why it behaves this way even though it explicitly says to use the JDK and NOT the JRE