Why can't eclipse resolve class in same package?

后端 未结 17 1857
逝去的感伤
逝去的感伤 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:11

    I've had the same problem with my Java project in eclipse. mvn clean-ing the project did not help strangely. I had to edit the supposedly "missing" class, save it, then clean and rebuild the project. That fixed the issue.

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

    In my case, the DoodleClient class had all its lines commented. It is not the way i wrote the class, it was a side effect of solving improperly a SVN conflict. So if you just ran an update on your project, you might perhaps want to check again the contents of your file.

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

    I tried to refresh the workspace (F5) and clean the project, but that did not do the trick. What worked for me was to right-click on the project and select 'Close Project'.

    Once closed I re-opened the project. This seemed to refresh all the files for the project in Eclipse.

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

    Right click on project-> Build Path ->Configure Build Path->Java Build Path -> then Fix issues in JRE System Library

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

    I got the same error in Maven project. Running Maven Clean and closing the project and reopening didn't work for me. Right click project -> Maven -> Update Project worked for me.

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

    I have the same issue every day, and the solution is different every time. :) You can try something like these:

    • Project menu - Clean
    • Project - Maven - Update project (Alt+F5)
    • Project - Refresh
    • Project - Run as - Maven clean
    • Project - Run as - Maven install
    • Restart Eclipse
    • Remove application from servlet container (if it is web app)
    • Pray.. :)
    0 讨论(0)
提交回复
热议问题