I make this call to a static singleton instance from the class GameManager.java
.
HUD.getInstance().update(timeDelta);
HU
I had to right-click the project, and select "Reimport" under the "Run Maven" submenu.
I was having the same problem except that I was importing the classes for which dependencies were not resolving somehow. I refreshed maven projects, Rebuild Project. It still did not resolve. Looks like IntelliJ was caching something incorrectly. I restarted IntelliJ and that resolved the dependencies. I guess it cleared the cache somehow.
Sometimes the class you want is in the test
source directory. Happened to me, anyway…
I'm seeing a lot of answers proposing a build or a re-build but just in case this don't fix your problem just notice that IDEA can detect a method but it will not compile in case you have a new
before as it will be expecting the instance.
In my case, I had a problem with finding a class from another module. In pom.xml
, I just had this dependency with <scope>compile</scope>
specified. Removing this line helped.
I had the same problem, and turns out I had never completely compiled the fresh project. So right-clicking and selecting Compile'' (shift-cmd-F9 on mac) fixed it. It seems the compile on save does not 'see' non-compiled files.
Marking the src folder as source did not help in my case.