JAVA_HOME should point to a JDK not a JRE
Control Panel -> System and Security -> System -> Advanced system settings -> Advanced -> Environment Variables -> New System Variable
I am going through the same process on Mac OSX. I installed the latest JDK, then installed Maven. Someone suggested I set the JAVA_HOME variable so I pointed it to the JDK installation folder. When running Maven mvn compile exec:java
I received the same error NB: JAVA_HOME should point to a JDK not a JRE
.
All I did was unset the JAVA_HOME variable and it worked.
do it thru cmd -
echo %JAVA_HOME% set set JAVA_HOME=C:\Program Files\Java\jdk1.8.0 echo %JAVA_HOME%