|Suddenly getting "Missing artifact com.sun:tools:jar:0" in Maven project [message #1761074]
||Sat, 06 May 2017 05:31
| David M. Karr
Registered: July 2009
I've been working with a largish multimodule Maven project, originally using JDK 1.8.0_102. This was working perfectly fine in Eclipse.
I had then tried to run the JDK 1.8.0_131 installer. The behavior of this seemed odd, as after I clicked the "Yes" button to run the application, it never brought up a dialog to ask where to install it. That seemed to cause a cascade of events that I don't quite understand.
The principal symptom is that now in Eclipse, all of the modules in this project are getting the error "Missing artifact com.sun:tools:jar:0".
At some point after this, I went to the Control Panel and uninstalled the JDK and JRE for 102 and 131. I then reinstalled the 102 JDK and made sure the "-vm" parameter in the eclipse.ini file is pointing to that jDK. Unfortunately, this resulted in no change to the symptom.
A reasonable guess for this would be that my JAVA_HOME is pointing to a JRE, not a JDK. That is not the case. I clearly set it to point to my "jdk1.8.0_102" distribution.
However, I did notice that there is a "C:\ProgramData\Oracle\Java\javapath" directory, and the contents of that directory are three files named "java", "Javaw", and "javaws", and they are symlinks to the binaries in the JRE, not the JDK, and that directory is first in my PATH.
I also ran visualvm and inspected the system properties of the Eclipse process. I saw some oddities in that list. In the "eclipse.commands" value, which looks somewhat like the contents of "eclipse.ini", I found two "-vm" values, the first being my JDK 102 location, and the SECOND being "c:\Program Files\Java\jdk1.8.0_102\bin\..\jre\bin\server\jvm.dll". I then saw that "java.home" was set to "c:\Program Files\Java\jdk1.8.0_102\jre".
I also note the following confusing output:
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
This tells me that JAVA_HOME points to the JDK, but executing java still thinks it's a JRE.
Powered by FUDForum
. Page generated in 0.01951 seconds