Import Tomcat source into Eclipse __java

Source: Internet
Author: User
Tags svn
Importing Tomcat's source code is simple, but if you don't find the right approach, you're wasting a lot of time, and I'm wasting a lot of time in configuring a compilation environment. The best thing to do is to go to Tomcat's official web site to find the answer.

Add a point: any software encountered installation and compile problems, the best way to go to the official website to find, check the document.
You can refer to the connection below, which is about TOMCAT7. Http://tomcat.apache.org/tomcat-7.0-doc/building.html 1. Setting up the Environment 1.1 JDK1.6 or above Java_home 1.2 Ant 1.8.1 or later Ant_home 2. Check out the latest Tomcat source code SVN--force export http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_ 0_11/d:\tomcat7\ above the command svn will download the latest Tomcat7011 source to your hard drive D:\Tomcat7\ under the SVN download address http://subversion.tigris.org/servlets/ Projectdocumentlist?folderid=91 3. Compiling engineering CD ${tomcat.source} ant ide-eclipse for Eclipse if your installed JDK is not 1.6, you will report a number of errors.
  My solution is to replace the original installed JDK1.7 with the 1.6 version of it. [note] A. ${tomcat.source} is the path to your downloaded source code on the machine B. Ant Ide-eclipse: This process will be slow because you will download some third-party jars that depend on you, and these jars will be placed in the BUILD.PR

The path to which the ${base.path} that is set in Operties is pointed. 4. Set the Eclipse environment (Class-path Variables) settings Tomcat_libs_base,ant_home tomcat_libs_base to point to ${base.path} ant_home point to Ann It would be nice to install ant's Directory: Open Eclipse's WINdow-> perferences, select Java->build Path-> Classpath, and then add the following two variables: Variables the Tomcat_libs_base same	        As the Base.path setting in Build.properties, where the binary dependencies have been downloaded Ant_home The base path of Ant 1.8.1 or later 5. Import Project File-> Import and choose Existing Projects into Workspace 6. Compile problems often we encounter some compile errors at this time because the JRE environment in Eclipse is set incorrectly and needs to be adjusted 6.1 Java Compiler, requiring 6.0 (1.6) + Windows-> Preferen Ces-> Java-> complier-> JDK Compliance-> 6.0 (1.6) 6.2 Default JRE requires more than 1.6 Window-> Prefe
   Rences-> Java-> installed JREs-> jdk1.6 Of course, this can also be set in the project, if you have other projects must use the previous JDK version. 6.3 Eclipse version problem when you adjust the Java Compiler and JRE, you can generally compile it, but I have a problem with the Eclipse version, and there's always a Compiler Arrayindexoutofboundar Yexception's mistake, and then I updated eclipse, and the eclipse version I used was 3.2.

I used eclipse Galileo to try to open the project, and there was no similar problem. 7. The most thoughtful service here, your project should be compiled successfully. Think about how to run, Debug Tomcat, how to set AH. Ha, the most thoughtful service has come,In the Run (Debug) ...-> Java application, we will see that there are already two applications, respectively called Start-tomcat, Stop-tomcat. Summary: The best learning materials or official documents, do not fear the pure English documents, brave to face to overcome it, in order to less detours.

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.