How to configure Tomcat in Eclipse and Tomcat in Eclipse
1. Configure Tomcat in Eclipse EE
Eclipse EE is mainly used for Java Web development and J2EE project development. It is relatively easy to configure Tomcat in Eclipse EE. just create a new Tomcat Server by taking the following steps:
1.1. Open the Servers view
Choose Window> Show View> Servers to open the Servers View.
1.2. Create a Tomcat server
Right-click the blank area and select New> Server (for environments without any Server, click the "new server wizard" Link). Then, select Tomcat Server in the list, select the corresponding version of the Local Machine. Select the local Tomcat directory and click Finish. At this point, Tomcat is successfully configured for Eclipse EE.
2. Configure Tomcat in Eclipse SE
Eclipse SE is mainly used for console program development. Eclipse EE is recommended for Web development. Of course, you can configure Tomcat in Eclipse SE as follows:
2.1. Download the Tomcat plug-in
: Download the token directly.
PS: Tomcat plug-in, not Tomcat. The two are different.
2.2. Install the Tomcat plug-in
Decompress the Tomcat plug-in, copy it to the Eclipse directory, and restart Eclipse. The Tomcat plug-in can be installed successfully.
2.3. Configure the Tomcat plug-in
In Eclipse, click Window-> Preferences-> Tomcat, select the local Tomcat version number (Tomcat has been downloaded and decompressed to the local), and select the Tomcat Home directory, that is, the Tomcat directory.
After configuration, start Tomcat in Eclipse and enter: localhost: 8080 in Eclipse's Internal Web Browser. If the Tomcat page appears, the Tomcat plug-in is successfully configured.
3. After Tomcat is started, a 404 error message is displayed on the page, prompting you to solve the problem.
Eclipse configures and starts Tomcat successfully, but sometimes the error 8080 occurs when accessing localhost: 404. In this case, you need to modify the Tomcat configuration. The procedure is as follows:
PS: if you cannot modify the configuration, delete Tomcat from the Server and add it again.