views:

277

answers:

2

Occasionally I see eclipse lose the reference to the third party jars contained in the a projects. (you get the the build path error stating the jar cannot be found)

Its easy enough to fix as you can remove the jar, save the properties of the project and then go in and re-add the jar that it could not find, eclipse can then see the path to the jar and you can then compile again.

the problem is that if you have a lot of projects in your build you would have to do this task a lot.

Is there anything you can do to force eclipse to recognise that it actually has the jar on its classpath?

A: 

That's a weird behaviour...

If that's ok you can use Maven 2 for your projects. This means that you have to follow Maven's project structure, which is quite ok, but it can be a pain if you decide to migrate old projects.

Then you can run mvn eclipse:eclipse whenever you want and that will fix your problem in a few seconds.

ivo
+1  A: 

I have also faced the similar situation many times with my projects in eclipse. The jar file path is correct in the .classpath file and the jar is present still eclipse do that. To fix it you open the .classpath file and resave it and refresh the probject in eclipse and it builds fine.

Bhushan
any idea why you have to do this?
Craig Angus
I think by changing the timestamp of the .classpath files forces eclipse to rebuild the project properly. God knows why rebuild action from menu not do that.
Bhushan