In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to solve eclipse configuration Tomcat and Tomcat invalid port problem, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to know it!
1. Eclipse configure Tomcat
1. Select window-preferences according to the figure
2 Select runtime environment at server
3. Click add on the right to select your own Tomcat version
Note that the corresponding versions of Tomcat and eclipse are different, the following is seen by the author online, the details can be considered by themselves.
Eclipse 4.8 (Photon)-Tomcat9.0
Eclipse 4.7 (Oxygen-Tomcat9.0
Eclipse 4.6 (Neon)-Tomcat9.0
Eclipse 4.5 (Mars)-Tomcat8.0
Eclipse 4.4 (Luna)-Tomcat8.0
Eclipse 4.3 (Kepler)-Tomcat7.0
4. After that, next, fill in the installation directory according to your own installation directory, and keep name and jre by default.
5. Then finish and apply. The project is not put on Tomcat at this time, and it still needs to be configured.
6. Create a new dynamic web project, as shown in the figure
To create a target runtime in the project, select the server. With the previous operation, you can select the server we configured, otherwise it can only be null.
7. After next,next, and then check create web.xml file, here I change content directory to content, so the directory created will be different, but it has no effect on the Tomcat configuration. Just finish directly when you're done.
8. Then select according to the figure
The interface appears
9. Double-click the blue font, pop up the interface next, select your own project, and click add
Finish can be done after add.
10. After writing the web project, right-click the blue background text in the figure and select start to start the Tomcat service.
2. Solution to invalid port in Tomcat
The following problem often occurs when Tomcat starts the service. After groping, it is found that there are multiple ports, or the port number is occupied. The solutions are as follows:
Method 1:
1. Select the server.xml file in the left servers, and double-click to open it.
two。 Click source in the lower left corner of the file
3. Here the port number is changed to 8888
Then start starts the service, and the service can be started
Method 2:
1. Find the bin file that downloaded Tomcat and find it in it
Click to find that the service is running, click stop to stop, and then make sure
->
The reason is that the local server is started in the bin directory, a copy of Tomcat is copied in eclipse, and the Tomcat integrated server is turned on at run time, so the port number is occupied.
Method 3:
Find the file under conf in the downloaded Tomcat and edit its port number to prevent port number conflicts.
This method is similar to the method. It should be noted that a copy of Tomcat is copied in eclipse. Here, the port number of the local server is changed, but the port number of Tomcat in eclipse is not changed. It needs to be reconfigured to be successful.
I feel that the changes mentioned on the Internet cannot be successful here, and that is why.
Reconfiguration is cumbersome, but there is also a concise way to do this:
1. Double-click the blue shaded sentence
two。 You can see that server path is not the path to the downloaded Tomcat, which proves that a copy of Tomcat is indeed copied in eclipse.
3. Click the second (use Tomcat installa) in the server locations, this selection will associate the server in the eclipse with the local server, and then change only one. However, it should be noted that it needs to be modified before the service is started, but it cannot be modified after it is started. I cannot modify it now.
These are all the contents of this article entitled "how to solve invalid port problems in eclipse configuration Tomcat and Tomcat". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.