1

I am getting the following error with my maven in eclipse.

The container 'Maven Dependencies' references non existing library '.....\.m2\repository\sun\jdk\jconsole\jdk\jconsole-jdk.jar'

I do not have a reference for jconsole-jdk.jar file in my pom.xml . My pom.xml is avaialble at http://pastebin.com/tdxmtHqN

Appreciate the help. I am stuck because of this issue.

Update: I removed all the dependencis and added it one by one. I got the error when I added the following depenency.

<dependency>
    <groupId>org.wildfly</groupId>
    <artifactId>wildfly-spec-api</artifactId>
    <version>8.1.0.Final</version>
    <type>pom</type>
    <scope>test</scope>
</dependency>

Regards -Albin

Albin Joseph
  • 1,020
  • 3
  • 16
  • 25

4 Answers4

4

I got the same problem after updating to Java 8 Update 25. As a workaround, I use an exclusion of the dependency to 'jconsole':

<dependency>
  ...
    <exclusions>
      <exclusion>
        <groupId>sun.jdk</groupId>
        <artifactId>jconsole</artifactId>
      </exclusion>
    </exclusions>
</dependency>
Stefan Großmann
  • 866
  • 9
  • 20
0

The jar should exist in your JDK/lib directory. You need to check which default JDK your IDE uses, or if there is a special one declared in your POM. Looks like you need a never version, or a JRE is set as default.

To find the default runtime in Eclipse:

Click "Window" -> "Preferences" -> type "jre" -> click "installed JREs". The one with the arrow is the default runtime.

Stefan
  • 12,108
  • 5
  • 47
  • 66
  • I have the following in my eclipse.ini -vm C:\Java\JDK7u51-x64\bin\javaw.exe . I checked the C:\Java\JDK7u51-x64\lib folder and I couldn't find jconsole-jdk.jar file there. But jconsole.jar file exists there. – Albin Joseph Aug 14 '14 at 11:43
0

I have found this works:

    <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-controller-client</artifactId>
        <version>8.2.0.Final</version>
        <scope>provided</scope>
        <exclusions>
          <exclusion>
            <groupId>sun.jdk</groupId>
            <artifactId>jconsole-jdk</artifactId>
          </exclusion>
        </exclusions>
    </dependency>

Note the jconsole-jdk part is different than Stefan's answer.

Matt
  • 362
  • 5
  • 21
0

This happened to me when I changed the location of my .M2 property file for where my local repository storage was pointing to.

IT happened for all packages at once.

If this is your problem also you can try right clicking on the package and selecting Maven\Update Project (Alt + F5).

Then I did a clean build and the problem was gone.