类引用的项目java不存在,类路径引用的归档不存在

My eclipse is Indigo Java classic.

I have a java project which has mockito-all as a dependency. pom.xml:

org.mockito

mockito-all

1.8.5

test

run mvn clean install, everything is ok. Then I did mvn eclipse:eclipse to resolve all the dependencies in Eclipse.

when I try to run a Junit in eclipse, it doesn't run and gives me this error:

'Launching YourTest' has encountered a problem.

The archive: /home/shengjie/.m2/repository/org/mockito/mockito-all/1.9.5.jar which is referenced by the classpath, does not exist.

My project pom.xml claims it's depending on mockito-all 1.8.5, I am not sure where the 1.9.5 reference is coming from. Any ideas?

==EDIT==

$ mvn dependency:tree | grep mockito

[INFO] +- org.mockito:mockito-all:jar:1.8.5:test

[INFO] \- org.powermock:powermock-api-mockito:jar:1.4.12:test

[INFO] \- org.powermock:powermock-api-mockito:jar:1.4.12:test

[INFO] +- org.mockito:mockito-all:jar:1.8.5:test (version managed from 1.9.0)

[INFO] | +- org.mockito:mockito-all:jar:1.8.5:test (version managed from 1.9.5; scope managed from compile)

[INFO] | +- org.mockito:mockito-all:jar:1.8.5:test (version managed from 1.9.5; scope managed from compile)

[INFO] \- org.powermock:powermock-api-mockito:jar:1.4.12:test

[INFO] +- org.mockito:mockito-all:jar:1.8.5:test

[INFO] +- org.powermock:powermock-api-mockito:jar:1.4.12:test

[INFO] | +- org.mockito:mockito-all:jar:1.8.5:test (version managed from 1.9.5; scope managed from compile)

解决方案

I had a similar problem while I was trying to start my tomcat. I would suggest that you check "Classpath" the following way:

1) Run Configurations

Right click on your project

then click "Run" -> "Run Configurations..."

there check your settings for you project (e. g. in my case it was the Apache Tomcat)

here look into you tab "Classpath" under "User Entries"

2) Project classpath

Right click on your project -> "Properties" -> "Java Build Path"

now check the "Source" Tab as well as your "Libraries" Tab

Problems should be marked red in the "Libraries" tab

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值