How to import project in eclipse springboot

First springboot project is based on maven, there must be maven environment.

This tutorial springboot to import a project as an example.

A springboot project a sql file.
Here Insert Picture Description

I environment :
eclipse4.5
jdk1.8
mysql5.7
maven3.2 (Maven limited edition, can be used)
Navicat database link tool.

The following is a reference installation package or later:
link: https://pan.baidu.com/s/1X-VHvB1FrIB5kYySjEd0Ng
extraction code: 0t2v

The tutorial steps:
(1) Configuration Environment maven
(2) introduced into the item
(3) Configuration Environment
(4) Link configuration database
(5) to start the project

A configuration maven environment

Download the official website: http://maven.apache.org/download.cgi

windows version:
Here Insert Picture Description

After downloading extract it to your disk

Here Insert Picture Description
Select the path just unpacked:
Here Insert Picture Description

Remember check:
Here Insert Picture Description
The final step: Select setting.xml
Here Insert Picture Description

Two import springboot project

Right-click on the left margin, import

Select Import maven
Here Insert Picture Description

Select the project location, project location is the best address in English, Chinese do not appear in the path address
Here Insert Picture Description

Here Insert Picture Description

Once complete, you need to download jar, take some time, according to speed download jar. May take more than 10 minutes it is also possible, and then wait for the download to complete.
Here Insert Picture Description

(3) configuration environment

A program error may occur after downloading the above, may not match with their jdk environment.

Select the right projects, build path -> configire build Path

Here Insert Picture Description

Here choose their own jdk, if a red X, remove appears, re-add jdk.
Here Insert Picture Description
Re-add:
Here Insert Picture Description

Here Insert Picture Description
Here select jdk, if you have not previously configured, there should be a default jre
Here Insert Picture Description

This time we want to add jdk.
Here Insert Picture Description
The Add your jdk installation address, and the hook. After determining, selecting jdk
Here Insert Picture Description

Here Insert Picture Description

Here Insert Picture Description

Here Insert Picture Description

Finally, select the project right choice maven update project .jdk might become jre can
Here Insert Picture Description

(4) modify the database configuration
in general springboot has a profile, link to your database. Depending on your configuration information database, your database name, password and other
Here Insert Picture Description
import sql file.

Open navcat database link tool, right click and choose New Database (random name and the name of the same to the above configuration)
Here Insert Picture Description

Here Insert Picture Description

Right select Run sql file, locate the file location choose OK.
Here Insert Picture Description

After running over, right click the database name, you can refresh end database configuration.

(5) to start the project

springboot project is built with integrated tomcat, no additional run tomcat

Run the following main method to start the project

Here Insert Picture Description

Right-class appearance of the space below run as running the project
Here Insert Picture Description
after launch access address: localhost: 8080 / mall

You can modify the port
Here Insert Picture Description

Published 167 original articles · won praise 182 · views 510 000 +

Guess you like

Origin blog.csdn.net/qq_22860341/article/details/89841188