Why can't eclipse resolve class in same package?

后端 未结 17 1859
逝去的感伤
逝去的感伤 2021-01-31 15:56

I hit F5 ~1000 times and restarted eclipse (also with -clean), deleted /bin, but nothing helps. Manually importing DoodleClient does not help. DoodleClient exists and is perfect

相关标签:
17条回答
  • 2021-01-31 16:25

    The first thing I would do is create a new class in the same package and check if it is visible from this class where you have the issue.

    Also I'm not sure but you could check to change the name of your class "D" for something different.

    and ...Check if the file actually does exist

    0 讨论(0)
  • 2021-01-31 16:26

    Tried many of the suggestions above w/o success (Eclipse restart, Clean multiple times, auto-suggest etc.). What got me out of this bind was a hard reset to a prior commit (I'm using git), building (this time w/ success), then pulling the latest sources of the project again and rebuilding.

    0 讨论(0)
  • 2021-01-31 16:27

    Alternatively, you can highlight the project :

    Choose Clean ... from Project menu and if you have activated the Build Automatically option (in the same menu), the classes will be generated anew.

    0 讨论(0)
  • 2021-01-31 16:30

    I could resolve it: On another project (from the same git repo), I had the same issue on several files in different packages. All I had to do was writing a white-space into the file, remove it again and save, so eclipse would re-compile it (I guess).

    Some kind of a strange behaviour... :S

    0 讨论(0)
  • 2021-01-31 16:34

    In my case it was that my Java Build Path -> Source didn't had checked the Contains test sources on my include source path and my code was JUnit

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