Build Path Issue with Maven Dependencies (jconsole-jdk.jar) [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-11-30 18:17:38

Solution was to change eclipse vm to jdk. Eclipse used jre - also I configured jdk.

If somebody else has the same problem, add following in eclipse.ini:

-vm 
C:\Program Files\Java\jdk1.7.0_60\bin\javaw.exe

Important:

The entry has to be placed in first two lines - as posted - in eclipse.ini !!! (Eclipse Luna and possibly others)

I ran across this issue and adding jdk to eclipse.ini did not solve this problem.

Eclipse tries to resolve jconsole.jar by following path relative to eclipse jre path

/../lib/jconsole.jar

Eclipse default JRE must point to JRE inside of JDK folder, so it can resolve jconsole.jar.

In my case my JRE eclipse was pointing to C:\Program Files\Java\jre1.8.0_20

Correct should have been C:\Program Files\Java\jdk1.8.0_20\jre

budha's solution doesn't work for me so I manually add the dependency in the pom:

    <dependency>
        <groupId>sun.jdk</groupId>
        <artifactId>jconsole</artifactId>
        <version>1.8</version>
        <scope>system</scope>
        <systemPath>C:\Program Files\Java\jdk1.8.0_60\lib\jconsole.jar</systemPath>
    </dependency>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!