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
I just wasted 3 hours with this problem until I managed to make it work. I had this error in the Eclipse Terminal when issuing a mvn compile command:
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
So I read here that I have to make a new system variable called JAVA_HOME and make it point towards the jdk installation folder. However this generated another error:
Source option 1.5 is no longer supported. Use 1.6 or later
Couldn't find a fix for this one so...
So the fix to make it all go away is install Java SE Development Kit 8! I was using 9 thinking that if it's the latest it must be better...
Anyway...
Install JDK8 from here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Then define the JAVA_HOME system environmental value - tutorial here: https://docs.oracle.com/cd/E19509-01/820-3208/inst_cli_jdk_javahome_t/
Restart Eclipse and enjoy! (at least that's what I did)
Hoping this spares some poor wanderer of some trouble.