Create Eclipse Project with Tomcat 7 Source Code

2 篇文章 0 订阅
1 篇文章 0 订阅

1. Download Tomcat source code

(1) from official webside: http://apache.etoak.com/tomcat/tomcat-7/v7.0.42/src/apache-tomcat-7.0.42-src.zip

(2) from svn: http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_27/

Directory of source code in my machine: F:\svn\tomcat7

2. Install Apache Ant

(1) http://apache.etoak.com//ant/binaries/apache-ant-1.9.2-bin.zip

(2) extract it under a directory, mine is D:\Program Files\apache-ant-1.9.2

(3) Add System Env Variable: append 'D:\Program Files\apache-ant-1.9.2\bin' to PATH (need reboot to take effect)

3. Build Eclipse Project

(1) open CMD window, go to your source code directory(mine is F:\svn\tomcat7), enter cmd as:

ant ide-eclipse

(2) If console gives you BUILD SUCCESSFUL message, that's great.

(3) if console gives you BUILD FAILED, you need check what error infromation it gives to you. For like what I met here: can't find javac to complie, JAVA_HOME is point to ****. To correct it, you need recheck your JAVA_HOME, or just put tool.jar under jdk/lib(D:\Program Files\Java\jdk1.6.0_26\lib) into the lib folder for ant(D:\Program Files\apache-ant-1.9.2\bin)

4. Import Project into Eclipse

(1) Import Existing Project

(2) You may have some error after imported, please check Problems View of your eclipse to see details

(3) Add two Classpath variables: Perferences -> Java ->  Build Path -> Classpath Variables -> New

(4) these two variables are: ANT_HOME - D:\Program Files\apache-ant-1.9.2, TOMCAT_LIBS_BASE - F:\usr\share (this folder is created when you doing build with Ant)

5. Run

(1) Everything would be ok now, you can start to run project

(2) Visit Tomcat welcome page by: localhost:8080

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值