- open Eclipse, click the Window menu, and select Preferences at the bottom.
- Click on the "Server" option and select "Runtime Environments" below.
- Click "Add" to add Tomcat.
-
Click "Next" to select the Tomcat path you have installed.
-
Click "Finish" to finish.
This time Tomcat has been deployed into eclipse, so what's the whole project going to run? See next step.
- First create a Web project
(file→new→dynamic Web project)
- Create a Dynamic Web project
- Point Click "Next" Next
-
Tap "Next" next
-
Click "Finish" to complete the
Project was created so that the Tomcat server is displayed on the console, Deploy the Web app to Tomcat, and see the next step.
- Add Tomcat to console
(window→show view→servers)
If Show View is not Servers, click Other (more), and then look for or search
li>
- Click Link No servers is available. Click ths link to create a new server. , select the Tomcat version in the dialog box that pops up.
- Click "Next" to add our items
(select items and click Add, or double-click to add to the right.) Every new project you create has to be added again
- Click Finish to complete the
- project that was successfully added to the eclipse Tomcat, and now click Run.
(post-run access address: localhost:8080)
Note: Web resources must be added under the Webroot directory (root directory).
Eclipse Configuration Associates Tomcat and runs the project