Tomcat Source Learning one: import eclipse

Source: Internet
Author: User
Tags svn

First, download the source code

Enter the official website http://tomcat.apache.org, click Download>tomcat9>source Code distributions>zip Download and unzip

Or check out the source code from the SVN repository, SVN path http://svn.apache.org/repos/asf/tomcat/trunk

After extracting or checking out, the directory is as follows and cannot be imported directly at this time

Second, ant compilation

1. Click Https://mirrors.tuna.tsinghua.edu.cn/apache//ant/binaries/apache-ant-1.10.1-bin.zip to download Ant's Zip installation package and extract it to d:/ Ant and create a new environment variable path, pointing to the extracted bin directory D:\ant\apache-ant-1.10.1\bin

2, (optional, because ant in the build process will download the dependent jar package, where you can modify the storage location of the jar package) Open the first step of the source directory, edit Build.properties.default

Locate Base.path, specify a custom directory, such as Base.path=d:/ant/tomcat-build-libs (new folder)

3. Under the Tomcat source directory, execute command line ant ide-eclipse

This process takes about 10 seconds until the output build successful. At this point, the. Project. classpath file is generated under this directory

Third, open Eclipse, menu Window>perference>java>build path>classpath Variables

1. New Ant_home and Tomcat_libs_base variables, Ant_home points to the ANT installation directory, such as d:/ant/apache-ant-1.10.1. Tomcat_libs_base points to the Base.path directory d:/ant/tomcat-build-libs configured above. If no changes are made, use the directory that the Base.path defaults to

2, import Tomcat source code, import>existing Projects into Workspace. At this time the project normal import, no error

3. Right-click Build.xml,run as > Ant build Build successful

4. Right-click Project, Run as > Java application>bootstrap>start-tomcat

Ok

Tomcat Source Learning one: import eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.