Just reimport didn't work. Following worked for me.
File -> Invalidate Caches /Restart
Then
Build -> Rebuild Project
That will reimport maven project.
Note : You need to invalidate the cache and also rebuild the project.
Answer from Durgesh Suthar on Stack OverflowJust reimport didn't work. Following worked for me.
File -> Invalidate Caches /Restart
Then
Build -> Rebuild Project
That will reimport maven project.
Note : You need to invalidate the cache and also rebuild the project.
I tried to "Maven > Reimport" but the only thing that actually fixed it was to close the project, delete the .idea directory, and reopen the project.
IntelliJ "package does not exist" error - Modder Support - Forge Forums
Intellij doesn't recognize Classes, Packages, and overall insist to not working.
Make sure that the Java sdk is configured correctly.
https://stackoverflow.com/questions/16765726/how-to-set-intellij-idea-project-sdk#16765841
And make sure that your sources directory is set as sources root
https://www.jetbrains.com/help/idea/content-roots.html
More on reddit.comPlease help me solve "package X does not exist"
How to resolve "package org.junit does not exist" in VSCode?
Videos
What am i doing wrong ? i have this project here:
C:\Users\username\IdeaProjects\ass1 2020
and
C:\Users\username\IdeaProjects\ass1 2020\src
that include 6 packages.
and intellij always keep sending me this errors:
Error: java: package <name> does not exist
like 100 errors like this.
why ? what am i doing wrong ?
all i did was to access the project files at
C:\Users\username\IdeaProjects\ass1 2020\src
, than copy there the java file i had.
why its not working ? do i need to configure to intellij that "hey a new packages arrived" or something ?
ALSO, the file:
C:\Users\username\IdeaProjects\ass1 2020\bin
is filled with the names of <name>.class of my previous assignment, looks like the program don't understand i switched the files. how do i explain that to intellij ?
Make sure that the Java sdk is configured correctly.
https://stackoverflow.com/questions/16765726/how-to-set-intellij-idea-project-sdk#16765841
And make sure that your sources directory is set as sources root
https://www.jetbrains.com/help/idea/content-roots.html
Not sure if this fixes your issue, but "rebuilding the project" has solved similar problems for me. Especially when I've been copying/moving classes.
Incase that doesn't work, you can try "invalidate cache and restart".
Hope it works out!