码迷,mamicode.com
首页 > 其他好文 > 详细

Tomcat源码编译

时间:2015-06-17 11:28:11      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:tomcat   配置   源码   编译   

1.下载

2.修改配置

将下载后的文件build.properties.default更名为build.properties.
打开build.properties,修改base.path=/home/jiangyu/share/eclipse/java

3.安装ant和java

不知道为什么,Tomcat7.x编译必须要jdk1.6,不能是jdk1.7,不然会报如下错.麻烦知道原因的告诉我.

build-tomcat-dbcp:
     [copy] Copying 64 files to /usr/share/java/tomcat7-deps/dbcp
     [move] Moving 64 files to /usr/share/java/tomcat7-deps/dbcp/src/java/org/apache/tomcat/dbcp
    [javac] Compiling 64 source files to /usr/share/java/tomcat7-deps/dbcp/classes
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
    [javac] /usr/share/java/tomcat7-deps/dbcp/src/java/org/apache/tomcat/dbcp/dbcp/BasicDataSource.java:53: error: BasicDataSource is not abstract and does not override abstract method getParentLogger() in CommonDataSource
    [javac] public class BasicDataSource implements DataSource {
    [javac]        ^
    [javac] /usr/share/java/tomcat7-deps/dbcp/src/java/org/apache/tomcat/dbcp/dbcp/DelegatingStatement.java:46: error: DelegatingStatement is not abstract and does not override abstract method isCloseOnCompletion() in Statement
    [javac] public class DelegatingStatement extends AbandonedTrace implements Statement {
    [javac]        ^
    [javac] /usr/share/java/tomcat7-deps/dbcp/src/java/org/apache/tomcat/dbcp/dbcp/DelegatingPreparedStatement.java:57: error: DelegatingPreparedStatement is not abstract and does not override abstract method isCloseOnCompletion() in Statement
    [javac] public class DelegatingPreparedStatement extends DelegatingStatement
    [javac]        ^
...

建议在eclipse编译,这样只要替换jdk路径就行了:
技术分享

4.编译

用ant编译.编译过程需要下载Tomcat需要的依赖包,请保持网络连接.
编译成功后,在根目录下会生成output的目录,进入output目录,在build目录下会发现lib,bin,conf等关键目录;将其拷贝到Tomcat根目录下即可.之后的怎么启动的过程就不用我说了吧.
技术分享

Tomcat源码编译

标签:tomcat   配置   源码   编译   

原文地址:http://blog.csdn.net/csujiangyu/article/details/46531855

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!