Sts Ide For Java

Spring Tool Suite (STS) is an Eclipse-based IDE which is optimized for developing Spring framework-based projects. If you are already using Eclipse IDE, you may consider installing STS as a plug-in for your existing Eclipse, because that's faster than downloading the STS separately. Which is better STS or Eclipse? Spring Tool Suite (STS) is a set of tools for creating Spring applications. It can be either installed as a plugin to an existing installation of Eclipse JEE or can be installed standalone. The standalone version of STS is also packaged with Eclipse EE, so all Eclipse features for Java EE development are available in STS too.

Sts Ide For Java
Hello friends lets discuss another important components Spring Boot Initializr of Spring Boot, it is a quick way to create spring boot project structure. In this article we are going to explore about Spring Boot Initializr with STS IDE. Spring Boot Initializr is used to quick start new Spring Boot Maven/Gradle projects within no time. It generates initial project structure and builds scripts to reduce Development time.Spring Tool Suite3 has long been a fantastic IDE for developing Spring applications. Since version 3.4.0 it has also been integrated with the Spring Initializr, making it a great way to get started with Spring Boot.

Related tutorials previously we have discussed

  • The default STS distribution is now based on the recently released Eclipse 2018-12 (4.10) release, including support for Java 11. Details about the Eclipse release can be found here: Eclipse 2018-12. Boot launch configs now feature full properties editing support.
  • It also looks like you are using an older version of STS. The latest versions of STS support the Java8 compiler settings already for a long time - independent of the JDK you are running the IDE itself on. – Martin Lippert Feb 29 '16 at 8:56.

Create a new Spring Boot application in Spring Tool Suite


Step 1: Select the New > Spring Starter Project menu item from the File menu.

Step 2: We will get the following “Spring Starter Project” Wizard to provide our project related information.

Step 3: Please provide our Spring MVC Maven Web Application Project details as shown below and Click on “Next” Button

Step 4: Click on “Finish” button to create our new Spring Boot Project.

Step 5: Now Spring STS Suite creates a Maven Project and downloads all required Jars to our Maven Local Repository.

Step 6: Once the project has been imported into your workspace, you’re ready to start developing your application.

Step 7: Execute Spring Boot Application Run As > Spring Boot Application from the Run menu.

Sts Ide For Java

Step 8: Access our Spring MVC application with “http://localhost:8080/MySpringBootApp” and observe the results

Sts ide for java

SpringApplication:

The SpringApplication class provides a convenient way to bootstrap a Spring application that will be started from a main() method. In many situations you can just delegate to the static

  • SpringApplication is one of the Spring Boot API classes.
  • SpringApplication class is used to bootstrap a Spring application that will be started from a main() method

MySpringBootAppApplication class is annotated with @SpringBootApplication annotation.

@SpringBootApplication does the following things:

  • Because of @Configuration annotation, It scans for @Bean methods to create beans.
  • Because of @ComponentScan annotation, It does component scanning (Components means Beans annotated with @Component,@Service,@Repository,@Controller etc).
  • Because of @EnableAutoConfiguration annotation, It triggers Spring Boot Auto-Configuration.

When we run MySpringBootAppApplication class main() method, it make a calls to “SpringApplication.run()” method. Then this call done following things

  • This call is used to create “AnnotationConfigEmbeddedWebApplicationContext”.
  • This “AnnotationConfigEmbeddedWebApplicationContext” instance is used to create an instance of “TomcatEmbeddedServletContainerFactory” class.
  • This “TomcatEmbeddedServletContainerFactory” is used to create an instance of “TomcatEmbeddedServletContainer” class.
  • TomcatEmbeddedServletContainer” instance starts a Tomcat Container at default port number: 8080 and deploys our Spring Boot WebApplication.
Sts Ide For Java

Summary

Congratulation!!! Here we have learned how to create Spring Boot Application with Spring Boot Intilizr via STS IDE. And also discussed code flow of run this spring boot application.

Happy Spring Boot Learning!!!

Spring Boot Related Topics

Sts Ide For Java Free

Ide

Sts Ide For Java Download

  1. Introduction to Spring Boot