Community
Participate
Working Groups
Build ID: Eclipse 3.3.0 I20070621-1340 Steps To Reproduce: 1.Simple java project with a library in classpath: combined from classpath variable and path to a network share 2.Open eclipse workspace without connection to network share with the library defined in projects build path 3.Project problem: Missing required library occurs (expected) 4.Close eclipse workspace und reconnect to network share 5.Start eclipse workspace 6.The mentioned error still occurs More information: The problem can't solved by clean or refresh the project. I've found two solutions (workarounds): 1. Add a new library to build path of the project which is stored on the same network share forces a update of the classpath and the error disappears. 2. Rename the classpath variable. Rebuild essential. Rename the classpath variable back to the further name und rebuild again. The classpath is updated correctly. Solution 2 works even if the classpath variable is used in more than one project.
Have you tried File > Refresh in the Java perspective ?
Yes I did. Neither Refresh or a project clean does invoke a classpath update.
I was able to reproduce with the following steps: 1. Start new workspace 2. Create new Java project with d:\temp\test\mylib.jar on the build path 3. Exit 4. Rename d:\temp\test into d:\temp\test.old 5. Restart Observe: A classpath marker shows a build path problem 6. Rename d:\temp\test.old into d:\temp\test 7. Select the Java project and refresh Observe: The classpath marker is still present (even if the jar appears in the Package Explorer Note that this must be a timing issue, as attempting to follow those steps running under the debugger failed to reproduce the bug. Investigating...
Actually steps from comment 3 won't show the problem every time. It sounds like a timing issue. Need to further investigate by looking at the code.
Created attachment 77382 [details] Possible fix I was never able to consistently reproduce the problem, but looking at the code, it looks like the work we do to refresh external jars on each auto-build job POST_CHANGE is interfering concurrently with the computing of external jars delta. As a result, the delta is computed and the external timestamps are updated, but the classpath validation is not done. Further refreshes do nothing since the timestamps are up-to-date. The fix consisted in avoiding this concurrency problem by moving the code elements to refresh on the delta state, and by not doing the refresh on each POST_CHANGE. As a consequence, a full build is not going to refresh the external jar, but as this bug shows this didn't work properly already. Only a refresh will now update the external jars. Note that this patch doesn't contain a regression test as this a timing problem. And the test that assumed that a full build would refresh the external jars has been removed.
Fix released for 3.4M2 in HEAD.
Is there a patch planed for eclipse 3.3?
The fix is not obvious, and we need to test it extensively in the 3.4 stream before we decide to backport it to 3.3.x. Note in addition to the workarounds you proposed, another workaround is to close/reopen the project when this happens.
Close and Reopen does not solve the problem. The error that the libraries are missing disappears but the error that a build paths error occures is still present.
Sorry I was not clear enough. After close/reopen you need to rebuild (might need a Project > Clean first)
Verified for 3.4 M2 using I20070917-0010.