Maven pointing to JRE instead of jdk

From the Maven Properties Guide:

${java.home} specifies the path to the current JRE_HOME environment use with relative paths to get for example: ${java.home}../bin/java.exe

java.home property is not the same thing as JAVA_HOME environment setting. It is actually dynamic property showing you which JRE is running your code. 

Try setting the java.home property correctly and see if it works.


In Eclipse, Window>Preferences>Java>Installed JREs> make sure jdk is present and selected.

If jdk and jre both are present, then delete jre from Installed JREs.


You can replace the environment from jre to jdk in Eclipse IDE as follows if it also shows compiler unavailable :

  • (right-click) your_project_name > Build Path > Configure Build Path > Libraries > (double-click) JRE System Libraries > Alternate Jre : jdk 1.8 >ok
  • Then from Installed JRES option in Libraries select jdk 1.8
  • Project > Clean
  • Maven > Update

Tags:

Java

Maven