I am trying to get a project to run using Maven in Eclipse, but I am getting this error below. The tools.jar
is in the JDK's lib
folder, but tools-1.6.jar
doesn't seem to exist on my computer. I am using the JDK 1.7 and my JAVA_HOME
is pointing to that folder (as is my eclipse.ini
) Anyone know where I can get this file or what I might be doing wrong?
The container 'Maven Dependencies' references non existing library C:\Users\sejohnson\.m2\repository\com\sun\tools\1.6\tools-1.6.jar
Look in your . m2 directory (use the paths which you see in the dialog above) and check whether the files are there or whether they are really missing. If they are missing, run "mvn install" (see the "Run as..." menu) to download them.
Most Eclipse IDE downloads already include support for the Maven build system. To check, use Help About and check if you can see the Maven logo (with the M2E ) sign.
To check maven is configured properly: Open Eclipse and click on Windows -> Preferences. Choose Maven from left panel, and select installations. Click on Maven -> "User Settings" option form left panel, to check local repository location.
The tools-x.y.z.jar should be provided by your JDK.
Make sure that eclipse is run by JDK and not by JRE by adding -vm option in eclipse.ini.
For example:
-vm
C:\Program Files\Java\jdk1.6.0_26\bin\javaw
New line after -vm
is crucial.
it should be right above
-vmargs
See also Eclipse Maven Plugin Configuration Problem
I had exactly the same problem and end up adding the following dependency to the pom file:
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>${java.version}</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
This fixed the problem and made tools.jar
available for QueryDSL plugin in my project. Hope this helps. Note, make sure that JDK version is used instead of JRE.
Edit: Recently noted that problem reappeared when I moved on new dev platform, in my case it was Ubuntu 12.10. The fix was to add ${JAVA_HOME}/bin
to the $PATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With