Missing artifact com.sun:tools:jar

I just posted over on this question about this same issue and how I resolved it, but I’ll paste (and expand on) it here as well, since it seems more relevant.

I had the same issue when using Eclipse in Windows 7, even when I removed the JRE from the list of JREs in the Eclipse settings and just had the JDK there.

What I ended up having to do (as you mentioned in your question) was modify the command-line for the shortcut I use to launch Eclipse to add the -vm argument to it like so:

-vm "T:\Program Files\Java\jdk1.6.0_26\bin"

Of course, you would adjust that to point to the bin directory of your JDK install. What this does is cause Eclipse itself to be running using the JDK instead of JRE, and then it’s able to find the tools.jar properly.

I believe this has to do with how Eclipse finds its default JRE when none is specified. I’m guessing it tends to prefer JRE over JDK (why, I don’t know) and goes for the first compatible JRE it finds. And if it’s going off of Windows registry keys like Vladiat0r’s answer suggests, it looks for the HKLM\Software\JavaSoft\Java Runtime Environment key first instead of the HKLM\Software\JavaSoft\Java Development Kit key.

Leave a Comment