Eclipse source out of sync with file system

前端 未结 10 1615
长发绾君心
长发绾君心 2020-12-08 19:07

I inherited a java project and don\'t have much experience with Eclipse. In the package explorer I can see the outline of the project with all the classes but when I try to

相关标签:
10条回答
  • 2020-12-08 19:48

    You can have Eclipse do that automatically for you.

    Using the latest version, go to Window -> Preferences.

    Select General -> Workspace and from there make sure the first and second option are checked:

    • Build automatically
    • Refresh using native hooks or polling

    This is very useful especially if you use Dropbox or something similar (wuala etc) :)

    0 讨论(0)
  • 2020-12-08 19:49

    If refresh and clean doesn't work, it might work to just simply just run your code. For me it did the trick. After many refresh and cleaning/ building didn't work.

    0 讨论(0)
  • 2020-12-08 19:49

    Just remove all projects from eclipse workspace and Re-Import the all projects again. It is working for me. Just try it

    0 讨论(0)
  • 2020-12-08 20:04

    just refreshing isnt always the answer. I had this source issue happen when I had imported two projects with the same context for review and Eclipse made me disambiguate them, forcing a change to the web context of the second. The source for one was linking to the other context's source folder. eg

    • project A(in folder A1) deployed as /A
    • project A(in folder A2) deployed as /A also but was forced to be /A[later**] upon import

    in .settings/org.eclipse.wst.common.component (within folder A1) the wb-module element referred to the other context /A[later] and was using its source code, not that for /A.

    I solved this by updating all references in the org.eclipse.wst.common.component file in each project to suit their correct project

    ** the suffix I chose upon import, it has no particular significance

    0 讨论(0)
提交回复
热议问题