This series of articles takes Apache Tomcat 6.0.41 as an example.
(1) Download Tomcat source code: Http://tomcat.apache.org/download-60.cgi,apache-tomcat-6.0.41-src.zip, unzip.
(2) Create a Java project in eclipse named: APACHE-TOMCAT-6.0.41-SRC
(3) Remove SRC from build path, then delete src and copy all apache-tomcat-6.0.41-src.zip files to Eclipse's APACHE-TOMCAT-6.0.41-SRC project, then add the Java and test folders to the build path under "Use as a source folder".
(4) In the project directory, add the folder Exlibs, place the required jar for compilation, add the jar to build Path, and add the JUnit Library.
(5) After successful compilation, find the Org.apache.catalina.startup.Bootstrap class, "Run as", "Java application"
At this time, if not an accident, will report a mistake:
This is due to the WebApps under the examples project error, the examples can be deleted directly.
The bootstrap is then re-run to start successfully.
Access: http://localhost:8080 in the browser to access Tomcat normally.
End
You can download the Eclipse project, which compiles successfully, directly here: http://download.csdn.net/detail/xuefeng0707/8177597
Tomcat source code parsing 1:eclipse importing Tomcat sources