将下载后的文件build.properties.default更名为build.properties.
打开build.properties,修改base.path=/home/jiangyu/share/eclipse/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路径就行了:
用ant编译.编译过程需要下载Tomcat需要的依赖包,请保持网络连接.
编译成功后,在根目录下会生成output的目录,进入output目录,在build目录下会发现lib,bin,conf等关键目录;将其拷贝到Tomcat根目录下即可.之后的怎么启动的过程就不用我说了吧.
原文地址:http://blog.csdn.net/csujiangyu/article/details/46531855