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