Maven build failed: "Unable to locate the Javac Compiler in: jre or jdk issue"
File eclipse.ini needs the vm
argument to point to your JDK location.
Edit the eclipse.ini
file to point to your JDK home, something as follows -
-vm
C:\Program Files\Java\jdk1.6.0_06
This ensures that Eclipse would be running off the JDK and not any default JRE on your machine.
You could try updating the JDK Eclipse is using, as follows:
Add and set the JRE in menu Window → Preferences... → Java → Installed JREs:
JRE type: Standard VM JRE
Name: jdk1.6.0_18
JRE home directory: C:\Program Files (x86)\Java\jdk1.6.0_18
If this is not the case, it's possible that the brackets and spaces in the JAVA_HOME path are causing issues. Try copying your JDK to a different location and updating your JAVA_HOME.
You try:
Go to Preferences/Java/Installed JREs
and add one for the location "C:\Program Files\Java\jdk1.6.0_27\jre
or something like that.
Remove the one for C:\Program Files\Java\jre6
As you can see, the path C:\Program Files\Java\jre6\..\lib\tools.jar
only makes sense if the first part (til the /..) is replaced by C:\Program Files\Java\jdk1.6.0_27\jre
.