Super detailed java web experiment environment (4) Eclipse configuration Tomcat configuration

Table of contents

1. Make sure the Tomcat server is closed

2. Configure Tomcat in Eclipse 

 3. Test whether Tomcat is configured

 4. If there is an exception


1. Make sure the Tomcat server is closed

2. Configure Tomcat in  Eclipse

1. Open Eclipse---->click Window---->click Preferences

 2.Server-->Click Runtime Environments

 3. Click Add

 4. Click APage-->Select the version you downloaded

 5. Click Next

 6. Your own Tomcat installation path -->next

 7. Click Apply and Close

 8. Click Window---->Show View---->Servers

9. 点击No servers are available. Click this link to create a new server...

 10. Select the Tomcat version you installed ----> and click Finish

 11. The content shown in the figure below will appear under the column ----> double-click this content

12. Select Use Tomcat installation at Server Locations...---->Change wtpwebapps to webapps---->Save this setting (click Save after crossing out)

 

 3. Test whether Tomcat is configured

 1. Right click --> click start

 4. If there is an exception

1. If the window shown in the figure appears, it means that the JDK version does not match the Tomcat version, so you need to re-download jdk or Tomcat. If you need to re-download jdk, you don’t need to reset the environment variable.

2. Eclipse runs the web project and reports an error message:

Several ports (8005, 8080, 8009) required by Tomcat v8.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

The reason for the error is: the port is occupied.

The main reason for the error is: when tomcat starts, closing eclipse directly will cause the port to be occupied. 

Solution:

In the tomcat directory, find the shutdown.bat in the bin folder and double-click to execute it, then go to eclipse to start tomcat and it will be successful! 

 

 

Guess you like

Origin blog.csdn.net/m0_66411584/article/details/127414083