package org.springframework.boot does not exist
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
The compiler error package org.springframework.boot does not exist means your project is trying to import Spring Boot classes, but the Boot libraries are not on the compile classpath. In practice, that usually comes down to missing dependencies, a broken build import, or an IDE that has not synchronized the project correctly.
Start with the Build File
For Maven, a minimal Spring Boot project typically needs the Boot parent or dependency management plus at least one starter dependency.
If the Boot starter dependency is missing, imports such as org.springframework.boot.SpringApplication will not resolve.
Gradle Needs the Same Basic Idea
For Gradle, the build must also apply the relevant plugin and dependencies.
If the plugin or dependency block is incomplete, the package will still appear missing even if the source code itself is fine.
Verify Dependency Resolution Outside the IDE
Before blaming IntelliJ or Eclipse, confirm that the build tool resolves dependencies from the command line.
For Maven:
For Gradle:
If the command-line build fails, the problem is in the project setup, not the IDE view of the project.
Common Causes
The usual causes are:
- missing Spring Boot dependency in
pom.xmlorbuild.gradle - missing repository configuration such as
mavenCentral() - corrupted local dependency cache
- incorrect project import in the IDE
- trying to compile a plain Java project that was never configured as Boot at all
These are classpath problems first, not Java syntax problems. Proxy or mirror misconfiguration can also block Maven or Gradle from downloading the artifacts, which produces the same missing-package symptom from the compiler's point of view.
IDE Sync Still Matters
Sometimes the build file is correct but the IDE has stale metadata. In that case:
- reimport the Maven or Gradle project
- invalidate IDE caches if the model is clearly stale
- verify the project SDK and language level
A correct build file with an out-of-sync IDE can still show the same missing-package error in the editor. That is why checking both the command-line build and the IDE model is worth the extra minute.
Confirm the Import You Expect
A small sanity check helps:
If this still fails after dependency resolution and project sync, the project classpath is not actually including Spring Boot yet.
Common Pitfalls
The most common mistake is adding Spring Framework dependencies but forgetting that Spring Boot classes live in Boot-specific artifacts.
Another mistake is editing the build file but never reimporting the project in the IDE.
It is also easy to assume the IDE error is authoritative when the command-line build has not been checked at all.
Summary
- The error means Spring Boot libraries are missing from the compile classpath.
- Fix the build file first, then verify dependency resolution from the command line.
- Reimport the project in the IDE after changing Maven or Gradle configuration.
- A correct Spring Boot starter dependency is usually the key missing piece.
- Treat this as a classpath and build configuration problem, not a source-code syntax problem.

