Explain how to create the first spring boot project under eclipse
Spring boot is a new framework provided by pivot team. It is designed to simplify the initial construction and development process of new spring applications. The framework uses a specific way to configure, so that developers no longer need to define templated configurations. In this way, boot is committed to becoming a leader in the booming field of rapid application development. In other words, spring boot is born to simplify spring development. The main idea is to reduce the introduction of spring so that novices can run programs under the spring framework as fast as possible.
Today, let's create the first project based on eclipse (eclipse-jee-neon-3-win32-x86_64. Zip) + spring boot.
1、 Install STS plug-in
To create projects in spring boot, eclipse must first install STS (Spring Tool Suite (STS) for Eclipse), and if the speed is awesome, you can choose to install online, otherwise you may choose to install offline.
1. Online installation
Help -> Eclipse Marketplace
Search or select the "popular" tab, select the spring tool suite (STS) for eclipse plug-in, and install:
2. Offline installation
(1) First download the STS plug-in at @ l_404_0@
(2)Help->Install New Software
(3) Click "add - > archive..", Then select the STS plug-in just downloaded, give the plug-in a name, and click "OK".
(4) Select several components ending in IDE to install. If the waiting events are long, you can install them one by one.
(5) Check whether the installation is successful
Window - > show view - > other, check whether there are spring components. If yes, it indicates that we have successfully installed them.
2、 Create a spring boot project
(1) Create a project and select spring starter project. Fill in various information related to the project, and then next:
(2) Select the required dependency, and then next:
(3) Finally, "finish" starts to download the jar package. This process takes a long time.
3、 Run project
(1) Right click the main method in demoapplication, run as - > spring boot app, and the project can be started.
(2) If you want to run Hello world, use the @ restcontroller annotation and add the Hello method.
How to run our application and see the output of Hello world?
The first method is to directly run the main method:
Select the main method of demoapplication - > right click - > run as - > java application, then open the browser and enter the address: http://127.0.0.1:8080/ You can see Hello world! Yes.
The second way:
Right click Project C > run as C > Maven build C > Enter spring boot: run in goals, then apply, and finally click Run.
4、 Pack
1. Command: clean package
2. Execute the command: Java CJAR XXXXXX jar
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.