Everything red in IntelliJ: project JDK misconfigured or symbols not resolved
Codemia Knowledge Hub ·
When IntelliJ IDEA marks every declaration or method in red, the code is usually fine and the project setup is not. The most common causes are a missing or misconfigured SDK, broken module settings, dependencies that have not synced from Maven or Gradle, and corrupted IDE caches. Work through them in that order.
Red underlines normally mean an unresolved declaration, method or import. When they show up everywhere, including on standard classes, they are pointing at configuration rather than at your code.
Causes and fixes
1. Missing or misconfigured SDK
If IntelliJ cannot find or link the SDK, it cannot resolve references, even to JDK classes.
- Fix: Open
File > Project Structure > Projectand check that the right SDK is selected. If it is missing, add it underFile > Project Structure > Platform Settings > SDKsand then select it.
2. Incorrect module configuration
Modules hold the settings for building, running and testing code. A module that is not configured or linked correctly produces unresolved symbols.
- Fix: Open
File > Project Structure > Modules. Check the source folders, output paths and dependencies, and make sure each module uses the correct language level.
3. Maven or Gradle dependency problems
External libraries are resolved through your build tool, so a broken Maven or Gradle configuration leaves their symbols unresolved.
- Fix:
- Maven: In the Maven Projects tool window, choose "Reimport All Maven Projects".
- Gradle: Click "Refresh all Gradle projects" in the Gradle tool window.
- Check
pom.xmlorbuild.gradlefor errors or missing artifacts. - If external repositories are unreachable, check your network connection.
4. Corrupted caches
Caches speed the IDE up, but a corrupted cache can report declarations as unresolved.
- Fix: Choose
File > Invalidate Caches / Restart, then invalidate and restart so IntelliJ rebuilds them.
5. Wrong or missing imports
Sometimes the import statements really are wrong or missing.
- Fix: Check the imports by hand, or use
Code > Optimize Importsand make sure every required package is imported.
Example: java.util.List shows red
Here a standard JDK interface appears unresolved:
Since List is part of the JDK, the import is not the problem:
- Check the SDK: Make sure the project SDK points to a valid JDK.
- Invalidate caches: If the SDK is correct and the red remains, invalidate caches and restart.
- Re-import dependencies: With
MavenorGradle, make sure the project is synced.
If none of that works
- IDE logs: Open them with
Help > Show Log in Explorer/Finderfor more detail on persistent problems. - Plugin conflicts: Some plugins interfere with normal operation. Disable non-essential plugins and see whether the problem goes away.
| Issue | Cause | Recommended Actions |
| Missing SDK/Invalid Project Setup | SDK not configured | Set appropriate SDK in Project Structure. |
| Incorrect Module Configuration | Module specifics like sources, output unset | Correct module settings in Project Structure. |
| Dependency Errors | Maven/Gradle config errors | Re-import project dependencies. |
| Cache Corruption | Cached data incorrect | Invalidate caches and restart IntelliJ. |
| Incorrect Import Statements | Missing or wrong imports | Ensure necessary imports are included. |
Related reading
- why spring-boot application doesn't require EnableWebMvc
- Why Spring Boot 2.0 application does not run schema.sql?
- Why Spring Boot Application class needs to have Configuration annotation?
- Why spring boot generates jar or war file with .original extension?
- Why TensorBoard summary is not updating?
- why tensorflow just outputs killed
- Why there is no ConcurrentHashSet against ConcurrentHashMap
- Why to use AllArgsConstructor and NoArgsConstructor together over an Entity?

OOD Fundamentals
Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.
View the courseData Structures & Algorithms practice on Codemia
Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.