idea import springboot project running tutorial

  • pre-requirements

① Possess a Java environment, and can install project dependencies through Maven;

② Equipped with IntelliJ IDEA tools, the professional version is recommended, and the community version does not affect;

③With Mysql5.7 or above version database;

④ Possess Navicat database visualization management tool;

⑤Google Chrome and Firefox browsers are recommended

  • run tutorial

①Open the Navicat database visualization tool and create a connection.

The connection name can be named freely; the host input ip address, the local is 127.0.0.1 or localhost; the port number defaults to 3306; the user name defaults to root; the password is set when the database is installed (the setting is often relatively simple, such as the password may be 123456, root such).

 

② Create a database.

Right-click the connection you just created, select New Database, and then enter the relevant database name and encoding format. Here, the encoding format must be in utf8 format .

 

③Import the SQL file.

Double-click or right-click to open the database

Then right-click to run the SQL file, select the location of the SQL file, and click Start to complete the import. After the import is complete, you need to refresh the following to import, right-click the table or database and select refresh.

 

 

 

 

④Open IntelliJ IDEA and import the source code root directory.

Open IntelliJ IDEA, open File>Open, then select the corresponding project root directory, and click OK to import the project.

 The import here is subject to your own project. It is best to put the project source code in the English path, not in the Chinese path or directly decompress and import.

 

⑤ Configure the JAVA project environment

Click File>Project Structure.

 

 

 

Then click on modules and configure it as JDK1.8

 

But after clicking in modules, the dependencies are configured as JDK1.8

 

Then click OK>OK.

⑥ Configure the Maven environment (you can’t or can’t configure it, or you can refer to the precautions)

Click on file->settings

 

Search for the maven configuration, and configure it to point to the local maven and maven configuration files. Or choose maven 3, and remove the tick mark below.

 

⑦Update maven.

And wait, the initial update is slow, you can also configure the local maven environment with idea

 

⑧ Configure the project database to point to the address.

Modify the database configuration in the project to the local database configuration.

 

 

Run the project .

Right-click and run src/main/java/root directory/xxxxxApplication.java to start the entire JAVA web project.

 

We can see the port number on the console, that is, the operation is successful.

 

⑩ access.

Use the recommended browser to open the project address of the corresponding console (http://127.0.0.1:port number/) to access it. The specific address depends on the project description.

  • Precautions

①The following problems may occur when using a higher version of MySQL above 5.6 :

Caused by: java.sql.SQLException: Expression #1 of ORDER BY clause is not in SELECT list, reference

Solution: https://blog.csdn.net/weixin_43232423/article/details/112507291

②The code is red, generally because the dependent packages in pom.xml are not imported. You need to confirm whether the Maven environment is configured correctly. Reference link: https://www.cnblogs.com/ckfuture/p/15821541.html

After the Maven configuration is complete, click Import.

Guess you like

Origin blog.csdn.net/weixin_46437112/article/details/127938352