Environment :Eclipse+Tomcat7 (or 8) +Jdk8+MySQL5.5

Note that the software version should be consistent, for example, Tomcat version 7 or 8, JDK version 8, MySQL version 5.5, 5.6, 5.7 and so on, many people do not look at the software version, a sudden operation, resulting in the subsequent project can not run. Also, be sure to finish the tutorial, finish the tutorial, finish the tutorial.

If the picture is not clear, click on the picture to enlarge it and make it bigger

Check the database VERSION: SELECT VERSION();

Steps to import the project and run it:

I. Import the project process

1. First click File-> Import

2, Choose existing projects into workspace

3. ① Select a directory, ② select a project, ③ Click Finsh

4. After successful import, javaWeb projects typically have a ball in the upper left corner. If yes, the import is successful; if no, the import is not successful. The import method may be incorrect or the environment is not paired

5. You can also modify the configuration to solve this problem

Eclipse configuration

Configure Project Facets, right-click the item, select Properties, and select Project Facets

First, make sure the Java option is selected, then if the Dynamic Web Module is not selected, select it, and a Furter Configuration availabe will be displayed. (If not, select apply, And then cancel, then apply, and then hit middle.

6. Note that after clicking Further Configuration availabe in the Dynamic Web Module, you need to set Content Directory to SRC /main/webapp

If an exclamation mark appears in the project, note that the configuration of the imported project is not the same as your Eclipse configuration. If no exclamation mark appears, do not change it

In the Java Build Path, select Libraries, select the JRE that reported the error, unbound has the error, then click Edit and replace it with JDK1.8. After the replacement is successful, the exclamation mark is not reported. If exclamation marks still appear, do your own search

7, modify the database configuration, the url behind a database, the name of the same as your local database name, also have to change the password, user name is not needed (generally default is root, if you know how to change the user, then this step is completely redundant for him)

The database configuration file may be in db.java, application. XML, or jdbc.properties (there aren’t many files).

Method: If you still can’t find, you can use global search to find, shortcut key: Ctrl+H

In File Serarch, type com.mysql (this is usually used with the username and password, it is easier to search for this keyword).

Search out the results inside, the user name and password can be changed

8, project run, you can click on the top left corner of the run (remember, to select the project before clicking run); Alternatively, right-click the project and Run-As -> Run on Server.

Remember, always click on the project, the entire project, not a single Java file or JSP page

Ii. Problem solving:

Eclipse frequently asked questions about importing and running JavaWeb projects and how to resolve them

Juejin. Cn/post / 698552…

Three, software download

Java common development software download address and problem solving

Juejin. Cn/post / 698552…

Note that if your project is still not up and running at this point, look at the front, where versions of the software are inconsistent.