I have my JAVA_HOME set to
C:\Program Files (x86)\Java\jdk1.6.0_18
After I run maven install I get this message from eclipse:
Reason:
Unable to locate the Javac Compiler in:
C:\Program Files (x86)\Java\jre6\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
I'm certain that this is the tricky part
Please ensure you are using JDK 1.4 or
above and
not a JRE
When I run configuration its set to JRE6, how do I change it to JDK 1.6 which I have already installed
EDIT
I even tried to modify the plugin :
org.apache.maven.plugins
maven-compiler-plugin
2.0.2
1.6
1.6
C:\Program Files (x86)\Java\jdk1.6.0_18\bin
Still I get the same error
Maybe I forgot to say I use eclipse maven plugin .. how can I change from JRE to JDK in eclipse ?
解决方案
You could try updating the JDK Eclipse is using, as follows:
Add and set the JRE in 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.