Spring BasicsCore· 35 min read

Setting Up with Spring Initializr

Spring Initializr is a website that builds a ready-to-run Spring Boot project for you — then you run it with one command.

What you will learn

  • Create a project with Spring Initializr
  • Pick the right starter dependencies
  • Run the app and see it start

The easiest start: Spring Initializr

Spring Initializr (at start.spring.io) is a free website that generates a fresh Spring Boot project. You choose a few options, click Generate, and download a ready-to-run zip. No manual setup.

For your first projects, choose these options:

OptionPickWhy
ProjectMavenA common build tool (handles libraries for you)
LanguageJavaThe language you already know
DependenciesSpring WebLets you build REST APIs (Unit 2)
Java versionThe defaultWhatever it suggests is fine

A dependency (also called a starter) is a bundle of code Spring adds for you. Spring Web pulls in everything needed for web APIs. Later you will add Spring Data JPA for databases.

Run the app

Unzip the project, open it in an editor like IntelliJ IDEA or VS Code, and run it. From a terminal you can also use the included Maven wrapper.

Terminal: run a Spring Boot app with the Maven wrapper
# from inside the unzipped project folder
./mvnw spring-boot:run

# on Windows use:  mvnw spring-boot:run

Note: Output: . ___ ( ( )\___ | Spring Boot ... Tomcat started on port(s): 8080 (http) Started DemoApplication in 1.8 seconds Spring Boot started its own web server (Tomcat) on port 8080. Your app is now live at http://localhost:8080 — you did not install a server yourself.

Tip: See Tomcat started on port 8080? That means it worked. By default your app runs at http://localhost:8080. Right now there are no pages yet — you will add your first endpoint in Unit 2.

Watch out: If you see Port 8080 was already in use, another program is using that port. Stop the other app, or change the port by adding server.port=8081 to src/main/resources/application.properties.

Q. What does Spring Initializr do?

Answer: Spring Initializr (start.spring.io) builds a starter project with the dependencies you select, so you can download it and run it straight away.

✍️ Practice

  1. Go to start.spring.io and create a Maven + Java project with the Spring Web dependency.
  2. Run the project and confirm you see “Tomcat started on port 8080”.

🏠 Homework

  1. Change the server port to 9090 using application.properties, run again, and note the new URL.
Want to learn this with a mentor?

CodingClave runs guided, project-based training (28-day, 45-day & 6-month batches).

Explore Training →