Getting “cannot find Symbol” in Java project in Intellij

前端 未结 24 848
清酒与你
清酒与你 2020-12-04 10:33

I make this call to a static singleton instance from the class GameManager.java.

HUD.getInstance().update(timeDelta);

HU

相关标签:
24条回答
  • 2020-12-04 11:01

    I know this thread is old but, another solution was to run

    $ mvn clean install -Dmaven.test.skip=true
    

    And on IntelliJ do CMD + Shift + A (mac os) -> type "Reimport all Maven projects".

    If that doesn't work, try forcing maven dependencies to be re-downloaded

    $ mvn clean -U install -Dmaven.test.skip=true
    
    0 讨论(0)
  • 2020-12-04 11:03

    I was getting the same "cannot find symbol" error when I did Build -> Make Project. I fixed this by deleting my Maven /target folder, right clicking my project module and doing Maven -> Reimport, and doing Build -> Rebuild Project. This was on IntelliJ Idea 13.1.5.

    It turns out the Maven -> Reimport was key, since the problem resurfaced a few times before I finally did that.

    0 讨论(0)
  • 2020-12-04 11:03

    This happened to me when I deleted a folder and then copy-pasted it back to the project.

    Right-click project folder -> Rebuild worked for me.

    0 讨论(0)
  • 2020-12-04 11:03

    I know this is old, but for anyone else, make sure that the class that's missing is in the same package as the class where you get the error/where your calling it from.

    0 讨论(0)
  • 2020-12-04 11:04

    If you are using Lombok, make sure you have enabled annotation processing.

    0 讨论(0)
  • 2020-12-04 11:05

    For me - I tried these steps(Invalidate Cache & Restart, Maven Reimport)) but they didn't work. So I deleted the .idea, .settings, and .project folder and tried - it worked.

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