Installation & Setup
Prerequisites
Make sure the following are installed on your machine:
| Component | Minimum Version | Check With |
|---|---|---|
| Java JDK | 17 or higher | java -version |
| Maven | 3.6+ or Gradle 7+ | mvn -version |
| IDE | IntelliJ, Eclipse, or VS Code | — |
Java 17 is an LTS (Long Term Support) release and is the minimum standard for Spring Boot 3.x.
Spring Initializr
The fastest way to create a Spring Boot project:
- Go to start.spring.io
- Select Maven Project (or Gradle)
- Set the Java version to 17
- Add the dependency: Spring Web
- Click Generate → download the ZIP
- Extract it into your working folder
IDE Setup
IntelliJ IDEA (Recommended)
- Install the Spring Boot plugin from the marketplace
- Open the project: File → Open → select the project folder
- IntelliJ automatically recognizes Spring Boot projects
Eclipse
- Install Spring Tools 4 from the Eclipse Marketplace
- Import: File → Import → Maven → Existing Maven Projects
VS Code
- Install the Extension Pack for Java + Spring Boot Extension Pack extensions
- Open the project folder
Creating Your First Project
After extracting, open a terminal in the project folder:
# With Maven
mvn spring-boot:run
# Or with Gradle
./gradlew bootRun
Wait until you see log output like this:
Tomcat started on port 8080 (http) with context path '/'
Started MyApp in 2.345 seconds
Verification
Open a browser and navigate to:
http://localhost:8080
You'll see the Whitelabel Error Page — this is normal, it means the application is running! We haven't created any controllers yet, so there are no pages to display.
Frequently Used Commands
mvn spring-boot:run # Run the application
mvn clean package # Build the JAR
java -jar target/app.jar # Run the JAR
mvn spring-boot:stop # Stop (if running in the background)
Common Troubleshooting
| Problem | Solution |
|---|---|
java not found |
Install JDK 17, check JAVA_HOME |
| Port 8080 already in use | Change the port in application.properties |
| Maven timeout | Check your internet connection, use a local mirror |
| Dependency error | Run mvn clean install -U |
Your project is now running on localhost:8080. In the next chapter, we'll understand the project structure of Spring Boot so you know the purpose of every folder and file.