

*/ ( "/api/example" ) public class ExampleController Package br._spring_eclipse_ntrollers import import .annotation.GetMapping import .annotation.RequestMapping import .annotation.RestController /** Use the code below to create the endpoint that will return “Hello-World!”:

Right click the main package and select New > Class:Īnd 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: Project created, now it’s time to create a Controller with a endpoint that will return a fixed String with the value: “Hello-World”. As dependency, only select the Web and click Finish. Select the latest stable version (on the writing date of this guide it’s the 2.1.4). Go to menu: File > New > Project… and select the option Spring starter Project which is located below Spring Boot menu, as the following image:įor this example, I’ll be using Maven as build-tool.įill the fields with the name of your artifact and groupId, and select the Type field as Maven:Īfter clicking next, we’ll have to especify which version of Spring we will be using. With everything correctly configured, it’s time to create our project.

Install the latest version of Spring Tools (on the writing date of this guide it is the 4.2.1) and restart eclipse. Go to menu Help > Eclipse Marketplace… and search for spring:

In order to have a better development experience with Spring, I recommend you to install the eclipse plugin: Spring Tools. If you installed Spring Tool Suite, it’s not necessary to follow the installation of Spring Tools below Spring Tools With eclipse installed, I suggest you to open it and start getting used with the GUI and also the shortcut keys. Open powershell and install eclipse using the following command line: If you don’t know Chocolatey, take a look at this post. 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). Use the following sections based in which operational system you’ll be using: Windows STS is basically eclipse configured with spring tools plugin, optimized for spring framework development It’s also worth to mention that installing Spring Tool Suite (STS) instead of pure eclipse, is highly valid.
