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
My answer pertains to the Eclipse in Windows environment.
I went to Preferences --> Java --> Installed JREs I did NOT see the JDK in here. I only saw the JRE here. So I added the JDK and then unchecked the JRE. Then checked JDK. Then I ran the POM file using Run Configurations. Choose the tab JRE and select the option "Workspace Default..." Here are the images