I\'m compiling a project in Eclipse using m2eclipse. I set the JDK path in Eclipse like this:
Windows-->preferences-->installed jres--> jdk1.7.xx p
There are several answers regarding this question but all are related to right path configuration of JDK, but with JRE only we can solve this problem.
We just need to make use of deployment assembly to configure the path of packaged war file of the Java EE Project and then re-run the maven-install.
Steps to make use of deployment assembly:
Right click on the Jave EE project --> click on Properties --> click on Deployment Assembly
Click on Add button --> Click on Archives from the File System --> Click on next --> Click on Add --> Go to the .m2\respository directory and search for the war file generated --> Select war file --> Click on Open button --> Click on Apply --> OK
Right click on the project --> Click on Maven Install under Run As
This will build your project successfully, without any compiler error.
Hope this solves the problem without JDK.