I\'ve been working with a co-worker on a problem I have been experiencing on a new project I just joined. Long story short, maven isn\'t building my .war file correctly. W
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 modify it on this window:
You can replace the environment from jre to jdk in Eclipse IDE as follows if it also shows compiler unavailable :
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.
This error also occurs, if you have variable named as javapath
. Try to delete it, if you've already specified e.g. like JAVA_HOME -> "C:\Program Files\Java\jdk1.8.0_171"
and then in Path -> "%JAVA_HOME%\bin"
Windows CMD don't refresh environment variables and you need run new instance for applying new environment setting and refresh new variable JAVA_HOME.