1. Download
- Go to the official website to download source http://tomcat.apache.org/download-70.cgi
- or import http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_62/from SVN in eclipse
2. Modify the configuration
Rename the downloaded file Build.properties.default to build.properties.
Open Build.properties, modify Base.path=/home/jiangyu/share/eclipse/java
3. Installing Ant and Java
Do not know why, tomcat7.x compile must be jdk1.6, cannot be jdk1.7, otherwise will report the following error. Tell me about the reason.
BUILD-TOMCAT-DBCP: [Copy] Copying -Files to/usr/share/java/tomcat7-deps/dbcp [move] Moving -Files to/usr/share/java/tomcat7-deps/dbcp/src/java/org/apache/tomcat/dbcp [Javac] Compiling -source files to/usr/share/java/tomcat7-deps/dbcp/classes [Javac] Warning: [Options] Bootstrap class path not set in Co Njunction With-source1.6[Javac]/usr/share/java/tomcat7-deps/dbcp/src/java/org/apache/tomcat/dbcp/dbcp/basicdatasource.java: -: Error:basicdatasource is notAbstractand does not overrideAbstractMethod 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.jav A: $: Error:delegatingstatement is notAbstractand does not overrideAbstractMethod 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/delegatingpreparedstate Ment.java: $: Error:delegatingpreparedstatement is notAbstractand does not overrideAbstractMethod Iscloseoncompletion () in Statement [Javac] Public class delegatingpreparedstatement extends delegatingstatement [javac ] ^...
It is recommended that you compile in eclipse so that you can simply replace the JDK path:
4. Compiling
compile with Ant. The compilation process needs to download the dependent packages that Tomcat requires, so keep your network connection.
After the successful compilation, the output directory will be generated in the root directory, the output directory will be found, in the build directory, the key directories such as lib,bin,conf will be discovered, and copied to the Tomcat root directory. Then how to start the process will not need me to say.
Tomcat Source Compilation