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 Overflow
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 4405958490770-Java-package-does-not-exist-error
Java "package does not exist" error โ€“ IDEs Support (IntelliJ Platform) | JetBrains
August 31, 2021 - The class is run on BlueJ, but I'd like to use IntelliJ. There is a package of helper classes, edu.duke, that I need to use. If I include the package edu.duke in the same folder as a class I am working on, there are no red squiggles or marks over the import statement; indeed, as you can see from the screenshot, the included classes are easily detected by the editor with a mouse hover. But I still get the "package edu.duke does not exist" error.
Discussions

IntelliJ "package does not exist" error - Modder Support - Forge Forums
Version: forge-1.12.2-14.23.5.2768-mdk Using IntelliJ Community 2018.3 I'm relatively new to this whole thing, and I'm having an issue where importing certain classes within the same packages into a certain other file fails for some reason. "MessageMod" is the main "@Mod" class. So my issue is th... More on forums.minecraftforge.net
๐ŸŒ forums.minecraftforge.net
December 16, 2018
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.com
๐ŸŒ r/IntelliJIDEA
6
6
July 11, 2018
Please help me solve "package X does not exist"
`src/main/*.java` will only pickup the java files directly under `src/main`. Try typing `ls /src/main/*.java` and you will see what I mean. If your OS supports it you can try a globstar: `src/main/**/*.java` but really you should be letting your IDE compile for you or use a build tool such as maven or gradle. I would recommend IntelliJ over VS code too for Java. More on reddit.com
๐ŸŒ r/javahelp
4
0
September 18, 2023
How to resolve "package org.junit does not exist" in VSCode?
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
๐ŸŒ r/javahelp
2
1
December 31, 2024
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 12200628643346-Recompiled-failed-java-package-does-not-exist
Recompiled failed, java: package does not exist โ€“ IDEs Support (IntelliJ Platform) | JetBrains
June 27, 2023 - Hi Arina Today, I try to reimport all modules and I thought I already find out the issue in Intellij. My project structure got: one parent project and 2 child modules. Parent project will include 2 modules (A and B) and module A will depend on module B. so if I change some of line source code in module A and doing re-compiled source code of module A then I will get the issue as: cannot find symbol or package does not exist.
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 203365204--package-does-not-exist-error-despite-autocomplete-being-aware-of-them
"package does not exist" error, despite autocomplete being aware of them โ€“ IDEs Support (IntelliJ Platform) | JetBrains
September 19, 2016 - The package is resolved just fine. Please try File | Invalidate Caches | Invalidate and Restart. ... After invalidating caches and restarting, same error for me. ... I'll try to spot the differences.
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 12712134551954-Maven-Java-Project-Package-Not-Found-Issue-in-IntelliJ-IDE
Maven Java Project - Package Not Found Issue in IntelliJ IDE โ€“ IDEs Support (IntelliJ Platform) | JetBrains
July 26, 2023 - You can try refreshing your project and reimporting it in IntelliJ IDEA. Right-click on the project root and select "Reimport." And verify that your IntelliJ IDEA is correctly configured, including JDK settings and project structure.
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 206997815-Unexpected-Package-Does-Not-Exist-Errors
Unexpected "Package Does Not Exist" Errors โ€“ IDEs Support (IntelliJ Platform) | JetBrains
November 6, 2005 - I think it's worth noting that there are no error marks (in red) in the editor windows, as I would have expected to be if the imports were indeed referring to packages that does not exist. The errors only appear when I compile. I tried looking for a solution here and elsewhere but came up empty. Can anyone help? Thank you, Oren ... Did you accidentally exclude a directory from your compiler settings in Project Settings -> Compiler? "Oren W." <no_mail@jetbrains.com> wrote in message news:19187541.1131280710678.JavaMail.itn@is.intellij.net...
Find elsewhere
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 360000940640-JDK11-package-does-not-exist
JDK11 package does not exist โ€“ IDEs Support (IntelliJ Platform) | JetBrains
October 1, 2018 - It kind of worked, packages like java.net.http are now recognized, but others aren't anymore ! For instance the class JSONObject is not recognized, and I can't import it. ... After research, it seems that the json packages are not available under Java SE.
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 360006996660-Java-package-does-not-exist
Java package does not exist โ€“ IDEs Support (IntelliJ Platform) | JetBrains
January 22, 2020 - When I run my code, I have the following error: Error:(3, 26) java: package javafx.application does not exist. I don't understand why I have this as it worked before. Thanks for any help :) ... JavaFX was removed from the JDK in Java 11. You now have to add it to your project as a library/dependency. Check out the Getting Started with JavaFX guide ... Please check "JavaFX and IntelliJ" part of documentation.
๐ŸŒ
MPS Support
mps-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 15656933947538-Building-MPS-Package-com-intellij-idea-does-not-exist
Building MPS: Package com.intellij.idea does not exist โ€“ MPS Support | JetBrains
December 9, 2023 - As for the missing dependency of the Ant plugin, this to me looks like some misconfiguration or a temporary problem. I do not get that on a fresh IDEA installation. You can most likely ignore it. ... Encounter an error while building MPS (Meta Programming System) due to the absence of the "com.intellij.idea" package.
๐ŸŒ
Forge Forums
forums.minecraftforge.net โ€บ home โ€บ mod developer central โ€บ modder support โ€บ intellij "package does not exist" error
IntelliJ "package does not exist" error - Modder Support - Forge Forums
December 16, 2018 - Version: forge-1.12.2-14.23.5.2768-mdk Using IntelliJ Community 2018.3 I'm relatively new to this whole thing, and I'm having an issue where importing certain classes within the same packages into a certain other file fails for some reason. "MessageMod" is the main "@Mod" class. So my issue is th...
๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 360002350579-Gradle-Being-told-packages-do-not-exist
Gradle - Being told packages do not exist โ€“ IDEs Support (IntelliJ Platform) | JetBrains
IntelliJ noob here. I've created a project using Kryo and its dependencies as libraries. The project compiles fine in IntelliJ, but if I try to build it into a jar with Gradle in the terminal, it gives me a load of error messages saying that packages don't exist.
๐ŸŒ
Medium
kubranka.medium.com โ€บ java-package-does-not-exist-in-intellij-188fd82f29f6
java : package does not exist in intellij - kubranka - Medium
December 8, 2022 - java : package does not exist in intellij If java gives error in title for your packages that has been seen before , do the following steps : Delete .idea file Open project again Right click on โ€ฆ
๐ŸŒ
JetBrains
youtrack.jetbrains.com โ€บ issue โ€บ IDEA-323361 โ€บ Cant-run-tests-java-package-X-does-not-exist
Can't run tests: java: package X does not exist : IDEA-323361
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
๐ŸŒ
Reddit
reddit.com โ€บ r/intellijidea โ€บ intellij doesn't recognize classes, packages, and overall insist to not working.
r/IntelliJIDEA on Reddit: Intellij doesn't recognize Classes, Packages, and overall insist to not working.
July 11, 2018 -

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 ?

๐ŸŒ
JetBrains
intellij-support.jetbrains.com โ€บ hc โ€บ en-us โ€บ community โ€บ posts โ€บ 10644073171858-Compilation-error-in-IntelliJ-IDEA-source-code-Package-not-found-and-symbol-cannot-be-resolved
Compilation error in IntelliJ IDEA source code: Package not found and symbol cannot be resolved โ€“ IDEs Support (IntelliJ Platform) | JetBrains
March 21, 2023 - -Module intellij.android.core: invalid item 'commons-lang' in the dependencies list -Module intellij.android.as-driver.utils: invalid item 'commons-lang' in the dependencies list -Module intellij.android.glance-designer: invalid item 'commons-lang' in the dependencies list -Module intellij.android.studio.integration: invalid item 'commons-lang' in the dependencies list -Module intellij.android.compose-designer.tests: invalid item 'commons-lang' in the dependencies list -Module android.sdktools.db-compiler: invalid item 'commons-lang' in the dependencies list ยท ------------------- It seems like the package org.apache.commons.lang cannot be found, and the symbol SystemUtils cannot be resolved.
๐ŸŒ
LabEx
labex.io โ€บ tutorials โ€บ java-how-to-fix-package-does-not-exist-error-in-java-417708
How to fix 'package does not exist' error in Java | LabEx
Since the package doesn't exist, the Calculator class within that package also doesn't exist. ... If it can't find the package in any of these locations, it reports the "package does not exist" error.