have been using Tomcat, want to understand the principle of tocmat, below to show you how to import the source code into eclipse;
Version apache-tomcat-6.0.39
here the official tutorial address http://tomcat.apache.org/tomcat-6.0-doc/building.html;
My entire import process is also based on the official tutorial, after all, the online version is too messy.
Prepare resources:
Tomcat6 Source: http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.39/src/;
ant1.8.0: http://archive.apache.org/dist/ant/binaries/ ;
The first step is to configure the ant environment variables
Create an ant_home environment variable to point the directory ${ant.home}, and modify the PATH environment variable Clude directory "${ant.home}/bin" in its list. This makes the ' ant ' command line scriptavailable, which'll be a used to actually perform the build.
ant_home=d:\apache-ant-1.8.0
Classpath=%ant_home%\lib;
Path=%ant_home%\bin;
The second step, download Tomcat dependency package, compile Tomcat source code
cd E:\apache-tomcat-6.0.39-src
ant download
ant
Before the operation, set the path to the existence of the dependent package.
Open E:\apache-tomcat-6.0.39-src路径下的 Build.properties.default File
Set base.path=d:/ant/tomcat_libs_base/
If you are using an HTTP proxy, please add the following configuration in Build.properties.default
proxy.host=代理IP
proxy.port=代理端口
proxy.use=on
以上工作准备好后,就进入第三步,导入eclispe
Use Windows->Preferences and then Java->Build Path->ClasspathVariables to add two new Classpath variables:
添加两个参数
TOMCAT_LIBS_BASE 值为D:/ant/tomcat_libs_base/
ANT_HOME 值为D:\apache-ant-1.8.0
Then create a new project from the >other>java project from existing Ant BuildFile
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6D/3A/wKiom1VeqIzzbkgTAAGZlQTjj9s471.jpg "style=" float: none; "title=" 1.png "alt=" Wkiom1veqizzbkgtaagzlqtjj9s471.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6D/35/wKioL1VeqgaSq8YaAAJe7KBREw0152.jpg "style=" float: none; "title=" 2.png "alt=" Wkiol1veqgasq8yaaaje7kbrew0152.jpg "/>
After completing the project, how do you get Tomcat to run?
To run Tomcat without a special IDE plug-in, you can simply use Run->run...enter "Org.apache.catalina.startup.Catalina" As the main class, "Start" as program arguments, and "-dcatalina.home= ..." (with the name of your build directory) as VM arguments.
It's really simple, right-click Run as > Run configurations Select Java application and then right-click to select New to appear as:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6D/3A/wKiom1VeqwnwyV2FAAGgEKlIYXc093.jpg "style=" float: none; "title=" 3.png "alt=" Wkiom1veqwnwyv2faaggekliyxc093.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6D/3A/wKiom1Veq8riE3kQAAIDOQAzCYM657.jpg "title=" 6.png " alt= "Wkiom1veq8rie3kqaaidoqazcym657.jpg"/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6D/3A/wKiom1VeqwrCTusKAAWPqo0tP98313.jpg "style=" float: none; "title=" 5.png "alt=" Wkiom1veqwrctuskaawpqo0tp98313.jpg "/>
This article is from the Spring researcher blog, so be sure to keep this source http://springxml.blog.51cto.com/4900689/1653828
Eclipse Import Tomcat Source