henda 发表于 2017-1-23 08:46:16

Tomcat源码解读--搭建eclipse工程(一)

  1、tomcat官网:http://tomcat.apache.org/index.html
  2、源码下载:http://tomcat.apache.org/download-70.cgi,选择下面的Source Code Distributions,如果是windows选择zip下载。
  3、Building withEclipse:把下载的源码导入eclipse
  http://tomcat.apache.org/tomcat-7.0-doc/building.html#Building_with_Eclipse 步骤如下:
  (1) 下载ant配置环境变量
  (2) 进入${tomcat.source}此目录,将build.properties.default 改为build.properties修改里面属性base.path=D:/ant/repository
  (3) 打开命令行(cmd),进入${tomcat.source}此目录,执行ant ide-eclipse
  (4) 配置eclipse环境变量,进入Java-Build Path-Classpath Variables
  TOMCAT_LIBS_BASE---在bulid.properties中设置base.path=D:/ant/repository
  ANT_HOME--- D:/apache-ant-1.8.1

  4、运行Main程序,main方法在Bootstrap.java,配置如下的vm参数和程序参数,就可以运行了。
  Program arg :start
  VM arg:-Dcatalina.home=“D:\workspace\test_tomcat\apache-tomcat-7.0.22-src\output\build”

  5、进入http://localhost:8080/,就可以校验是否启动成功。
页: [1]
查看完整版本: Tomcat源码解读--搭建eclipse工程(一)