Import the Tamcat source into eclipse

Source: Internet
Author: User

Read a lot of tutorials on the Internet, finally finished, put it up to share with you

First go to ant official website http://ant.apache.org/bindownload.cgi download ant tool

then unzip to a directory and add the bin directory in the ant directory to the environment variable path. So that you can use the Ant command

in the command line interface and then download the Tomcat source code, I'm using TOMCAT7, the bottom source of the http://tomcat.apache.org/download-70.cgi page The Code distributions tag

is downloaded and then extracted to a directory, then use the cmd command to enter the directory, the "ant" Command

followed by a long wait, waiting to download the Tomcat-dependent jar package. After the

finishes executing, and then executing the "ant-p" command, you can see that there is a ide-eclipse file

In the result, and then you execute "Ant Ide-eclipse", and when you are done, you build the. project file in the current directory
open Eclipse, the source directory when the normal Java project import can be

after importing, the project may not be compiled, because the lack of tomcat-dependent jar package (the previous execution of the ant command when the dependent package has been completely downloaded, So most of the build path path is not correct, and then subdivide the fact that Ant_home and Tomcat_libs_base did not add to classpath variables, Ant_home is ANT's decompression directory, Tomcat_libs_ Base is the directory where ant downloads the jar package, I'm d:/usr/share/java, if I can't find it, remove all the jar packages containing ant_home and tomcat_libs_base and import those jar packages into the project myself. The Ant jar package is in the Lib directory of the ant directory that you downloaded earlier.

After all the jars have been correctly imported, there should be no problem, if the test source error, as long as they are commented out there is no problem, does not affect the operation of Tomcat.

To execute org.apache.catalina.startup.Bootstrap, you can start Tomcat, and then access localhost:8080 will appear on the Tomcat home page

Reference: http://onlyor.iteye.com/blog/1698085

Import the Tamcat source into eclipse

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.