Posts Java spring boot + eclipse

Java Spring Boot + Eclipse

Java and spring boot logo with a plus sign followed by eclipse logo


To those who develop in java nowadays, it’s almost impossible to miss Spring framework and more specifically Spring Boot. Using this development stack, we gain more productivity and agility from small to large sized java projects. In this guide I’ll demonstrate how to install, configure eclipse and create a simple Hello-World using java, eclipse and spring boot.

The github repository of the example project of this post, can be found at:


  • Java JDK 8 or higher

Installing Eclipse

It’s also worth to mention that installing Spring Tool Suite (STS) instead of pure eclipse, is highly valid. STS is basically eclipse configured with spring tools plugin, optimized for spring framework development

Use the following sections based in which operational system you’ll be using:


In Windows we have 2 options:

  • Direct download

    Go to eclipse download page, select the latest version (on the writing date of this guide is the 4.10 and install it using NNF (next, next and finish).

  • Using a package manager (Chocolatey)

    If you don’t know Chocolatey, take a look at this post.

    Open powershell and install eclipse using the following command line:

      choco install eclipse


In Linux we also have 2 options:


In macOS we have 2 options again:

  • Direct download

    Go to eclipse download page, select the latest version (on the writing date of this guide is the 4.10 and install it as usual, dragging the app from the .dmg file to the apps folder of your mac.

  • Using a package manager (Homebrew)

    If you don’t know Homebrew, take a look at this post

    Open your favorite terminal and install eclipse using the following command line:

    brew cask install eclipse-ide

Configuring eclipse

With eclipse installed, I suggest you to open it and start getting used with the GUI and also the shortcut keys.

If you installed Spring Tool Suite, it’s not necessary to follow the installation of Spring Tools below

Spring Tools

In order to have a better development experience with Spring, I recommend you to install the eclipse plugin: Spring Tools. Go to menu Help > Eclipse Marketplace… and search for spring:

Installing Spring ToolsInstalling Spring Tools

Install the latest version of Spring Tools (on the writing date of this guide it is the 4.2.1) and restart eclipse.

Creating the project

With everything correctly configured, it’s time to create our project. Go to menu: File > New > Project… and select the option Spring starter Project which is located below Spring Boot menu, as the following image:

Starting the projectStarting the project

For this example, I’ll be using Maven as build-tool.

Fill the fields with the name of your artifact and groupId, and select the Type field as Maven:

Starting the project using MavenStarting the project using Maven

After clicking next, we’ll have to especify which version of Spring we will be using. Select the latest stable version (on the writing date of this guide it’s the 2.1.4). As dependency, only select the Web and click Finish.

Select Spring version and dependenciesSelect Spring version and dependencies

Project created, now it’s time to create a Controller with a endpoint that will return a fixed String with the value: “Hello-World”. Right click the main package and select New > Class:

Creating a classCreating a class

And create a class named “ExampleController” and fill the suffix of the package with “.controllers”, so a package named controllers will be created and nest your class, and it will group other controllers:

Creating ExampleControllerCreating ExampleController

Use the code below to create the endpoint that will return “Hello-World!”:


import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

 * ExampleController
 * @author danielpadua
public class ExampleController {

	public ResponseEntity<String> get() {
		return ResponseEntity.ok("Hello World!");

Run the project by clicking the button Boot Dashboard and then the tab Boot Dashboard at the bottom of the screen. Select the name of your project and click the run button:

Running the projectRunning the project

After clicking run button, you will see the output log of spring initialisation in console tab:

Spring initialisation logSpring initialization log

To test the project, you only have to open your favorite browser and access: http://localhost:8080/api/example/hello-world and you should be seeing the Hello World message:



Eclipse and Spring Tool Suite (STS) are greate IDEs for developing robust java and spring based applications, and due to the stability of the tool, it ends up being super easy the ‘start’ of a simple project.

See you soon!

This post is licensed under CC BY 4.0 by the author.